diff --git a/.gas-snapshot b/.gas-snapshot index 12d48a9..65becd5 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,95 +1,95 @@ -CharacterAccountTest:testEquipAndUnequipViaMultiSendDelegateCall() (gas: 863829) -CharacterAccountTest:testEquipItemToCharacter() (gas: 876711) -CharacterAccountTest:testEquipViaMultiSendDelegateCall() (gas: 884134) -CharacterAccountTest:testUnequipItemToCharacter() (gas: 871463) -CharacterAccountTest:test_Owner() (gas: 592206) -CharacterEligibilityAdaptorTest:testIsEligible() (gas: 53505) +CharacterAccountTest:testEquipAndUnequipViaMultiSendDelegateCall() (gas: 854002) +CharacterAccountTest:testEquipItemToCharacter() (gas: 869843) +CharacterAccountTest:testEquipViaMultiSendDelegateCall() (gas: 876374) +CharacterAccountTest:testUnequipItemToCharacter() (gas: 863514) +CharacterAccountTest:test_Owner() (gas: 588641) +CharacterEligibilityAdaptorTest:testIsEligible() (gas: 53339) CharacterEligibilityAdaptorTest:testSupportsInterface() (gas: 13415) -CharacterSheetsFactoryTest:testCreateAndInitialize() (gas: 3883681) -CharacterSheetsFactoryTest:testCreateAndInitializeWithZeroDao() (gas: 3680766) -CharacterSheetsFactoryTest:testCreateCharacterEligibilityAdaptor() (gas: 110677) -CharacterSheetsFactoryTest:testCreateCharacterSheets() (gas: 108660) -CharacterSheetsFactoryTest:testCreateClassLevelAdaptor() (gas: 111294) -CharacterSheetsFactoryTest:testCreateClasses() (gas: 110538) -CharacterSheetsFactoryTest:testCreateExperience() (gas: 108715) -CharacterSheetsFactoryTest:testCreateItems() (gas: 110556) -CharacterSheetsFactoryTest:testDeployment() (gas: 13097) -CharacterSheetsFactoryTest:testDeploymentRevert() (gas: 16680) -CharacterSheetsFactoryTest:testInitializeContracts() (gas: 3836586) +CharacterSheetsFactoryTest:testCreateAndInitialize() (gas: 3856606) +CharacterSheetsFactoryTest:testCreateAndInitializeWithZeroDao() (gas: 3654053) +CharacterSheetsFactoryTest:testCreateCharacterEligibilityAdaptor() (gas: 110455) +CharacterSheetsFactoryTest:testCreateCharacterSheets() (gas: 108501) +CharacterSheetsFactoryTest:testCreateClassLevelAdaptor() (gas: 111072) +CharacterSheetsFactoryTest:testCreateClasses() (gas: 110379) +CharacterSheetsFactoryTest:testCreateExperience() (gas: 108556) +CharacterSheetsFactoryTest:testCreateItems() (gas: 110397) +CharacterSheetsFactoryTest:testDeployment() (gas: 12992) +CharacterSheetsFactoryTest:testDeploymentRevert() (gas: 16575) +CharacterSheetsFactoryTest:testInitializeContracts() (gas: 3812465) CharacterSheetsFactoryTest:testUpdateImplementationAddressStorage() (gas: 21525) -CharacterSheetsTest:testChangeBaseUri() (gas: 71847) -CharacterSheetsTest:testChangeBaseUriRevertNotAdmin() (gas: 71773) -CharacterSheetsTest:testEquipItemToCharacter() (gas: 333754) -CharacterSheetsTest:testEquipItemToCharacterReverts() (gas: 218278) +CharacterSheetsTest:testChangeBaseUri() (gas: 70874) +CharacterSheetsTest:testChangeBaseUriRevertNotAdmin() (gas: 70905) +CharacterSheetsTest:testEquipItemToCharacter() (gas: 331497) +CharacterSheetsTest:testEquipItemToCharacterReverts() (gas: 216303) CharacterSheetsTest:testGetCharacterSheetByCharacterId() (gas: 25401) -CharacterSheetsTest:testGetPlayerIdFromAccountAddress() (gas: 30169) -CharacterSheetsTest:testRemovePlayer() (gas: 950076) -CharacterSheetsTest:testRenounceSheet() (gas: 73077) -CharacterSheetsTest:testRenounceSheetReverts() (gas: 72763) -CharacterSheetsTest:testRestoreSheetAfterRemove() (gas: 789823) -CharacterSheetsTest:testRestoreSheetAfterRenounce() (gas: 745521) -CharacterSheetsTest:testRollCharacterSheet() (gas: 590551) -CharacterSheetsTest:testRollCharacterSheetAsGameMaster() (gas: 608454) +CharacterSheetsTest:testGetPlayerIdFromAccountAddress() (gas: 29959) +CharacterSheetsTest:testRemovePlayer() (gas: 943533) +CharacterSheetsTest:testRenounceSheet() (gas: 72626) +CharacterSheetsTest:testRenounceSheetReverts() (gas: 72312) +CharacterSheetsTest:testRestoreSheetAfterRemove() (gas: 783035) +CharacterSheetsTest:testRestoreSheetAfterRenounce() (gas: 738840) +CharacterSheetsTest:testRollCharacterSheet() (gas: 586266) +CharacterSheetsTest:testRollCharacterSheetAsGameMaster() (gas: 603823) CharacterSheetsTest:testRollCharacterSheetFailNonMember() (gas: 61327) CharacterSheetsTest:testRollCharacterSheetRevertAlreadyACharacter() (gas: 68064) -CharacterSheetsTest:testRollFailsForRenouncedSheet() (gas: 116583) -CharacterSheetsTest:testSafeTransferFrom() (gas: 469420) -CharacterSheetsTest:testSafeTransferFromBackAndForth() (gas: 268713) -CharacterSheetsTest:testTransferFrom() (gas: 480370) -CharacterSheetsTest:testUnequipItemFromCharacter() (gas: 316904) -CharacterSheetsTest:testUpdateCharacterMetadata() (gas: 98745) -CharacterSheetsTest:testUpdateContractImplementation() (gas: 5140268) -ClassLevelAdaptorTest:testFuzz_GetCurrentLevel(uint256) (runs: 256, μ: 36977, ~: 32811) +CharacterSheetsTest:testRollFailsForRenouncedSheet() (gas: 116132) +CharacterSheetsTest:testSafeTransferFrom() (gas: 460478) +CharacterSheetsTest:testSafeTransferFromBackAndForth() (gas: 265721) +CharacterSheetsTest:testTransferFrom() (gas: 472120) +CharacterSheetsTest:testUnequipItemFromCharacter() (gas: 313885) +CharacterSheetsTest:testUpdateCharacterMetadata() (gas: 97123) +CharacterSheetsTest:testUpdateContractImplementation() (gas: 5127701) +ClassLevelAdaptorTest:testFuzz_GetCurrentLevel(uint256) (runs: 256, μ: 36834, ~: 31396) ClassLevelAdaptorTest:testSupportsInterface() (gas: 13415) -ClassesTest:testAssignClass() (gas: 282119) -ClassesTest:testClaimClass() (gas: 156632) -ClassesTest:testClassExp() (gas: 257055) -ClassesTest:testCreateClass() (gas: 134722) -ClassesTest:testFuzz_BalanceOf(uint256) (runs: 256, μ: 297240, ~: 306438) -ClassesTest:testRenounceClass() (gas: 240969) -ClassesTest:testRevokeClass() (gas: 213393) -ClassesTest:testTransferClass() (gas: 763240) -ExperienceTest:testBurnExp() (gas: 195606) -ExperienceTest:testDropExp() (gas: 252084) +ClassesTest:testAssignClass() (gas: 280150) +ClassesTest:testClaimClass() (gas: 155829) +ClassesTest:testClassExp() (gas: 253585) +ClassesTest:testCreateClass() (gas: 132681) +ClassesTest:testFuzz_BalanceOf(uint256) (runs: 256, μ: 294846, ~: 304286) +ClassesTest:testRenounceClass() (gas: 238835) +ClassesTest:testRevokeClass() (gas: 211570) +ClassesTest:testTransferClass() (gas: 757342) +ExperienceTest:testBurnExp() (gas: 194091) +ExperienceTest:testDropExp() (gas: 249912) ExperienceTest:testExperienceDeployment() (gas: 18154) -HatsAdaptorTest:testAddGameMaster() (gas: 148299) -HatsAdaptorTest:testHatsAdaptorDeployment() (gas: 115416) -HatsAdaptorTest:testIsCharacter() (gas: 87091) -HatsAdaptorTest:testIsGameMaster() (gas: 64484) -HatsAdaptorTest:testIsPlayer() (gas: 86641) -HatsAdaptorTest:testMintCharacterHat() (gas: 213533) -HatsAdaptorTest:testMintPlayerHat() (gas: 699074) -HatsAdaptorTest:test_CheckCharacterHatEligibility() (gas: 93052) +HatsAdaptorTest:testAddGameMaster() (gas: 135267) +HatsAdaptorTest:testHatsAdaptorDeployment() (gas: 111369) +HatsAdaptorTest:testIsCharacter() (gas: 85417) +HatsAdaptorTest:testIsGameMaster() (gas: 63121) +HatsAdaptorTest:testIsPlayer() (gas: 84849) +HatsAdaptorTest:testMintCharacterHat() (gas: 210898) +HatsAdaptorTest:testMintPlayerHat() (gas: 694017) +HatsAdaptorTest:test_CheckCharacterHatEligibility() (gas: 92575) HatsAdaptorTest:test_addValidGame() (gas: 210) -ItemsTest:testClaimItem() (gas: 877241) -ItemsTest:testClaimItemRevert() (gas: 1269731) -ItemsTest:testComplexRequirementsClaimRevert() (gas: 1255162) -ItemsTest:testComplexRequirementsClaimRevertWithTooMuchExp() (gas: 1284692) -ItemsTest:testComplexRequirementsClaimWithItem1() (gas: 1331550) -ItemsTest:testComplexRequirementsClaimWithItem1ForShallowNot() (gas: 1285853) -ItemsTest:testComplexRequirementsClaimWithItem2() (gas: 1336408) -ItemsTest:testCraftItem() (gas: 703549) -ItemsTest:testCraftItemRevert() (gas: 433785) -ItemsTest:testCreateClaimableItem() (gas: 77587) -ItemsTest:testCreateCraftableItem() (gas: 69379) -ItemsTest:testCreateItemTypeRevert() (gas: 64124) -ItemsTest:testDeleteItem() (gas: 240296) -ItemsTest:testDismantleItems() (gas: 1171490) -ItemsTest:testDismantleItemsRevert() (gas: 1229586) -ItemsTest:testDropLoot() (gas: 1247865) -ItemsTest:testDropLootRevert() (gas: 258449) -ItemsTest:testInvalidTreeAnd() (gas: 632503) -ItemsTest:testInvalidTreeNot() (gas: 849700) -ItemsTest:testInvalidTreeOr() (gas: 866734) -ItemsTest:testSimpleRequirementsClaimWithItem1() (gas: 627818) -ItemsTest:testURI() (gas: 20896) -ItemsTest:testUpdateClaimableItemRequirements() (gas: 337268) -ItemsTest:testUpdateCraftableItemRequirements() (gas: 196644) -Test_AdminEligibilityModule:testAddNewAdmin() (gas: 144310) -Test_AdminEligibilityModule:testRemoveAdmin() (gas: 124992) -Test_ElderEligibilityModule:testAddClassToElderModule() (gas: 466146) -Test_ElderEligibilityModule:testCharacterSheetsLevelEligibilityModule() (gas: 659917) -Test_ElderEligibilityModule:testElderModuleNoCharacter() (gas: 472720) -Test_GameMasterEligibilityModule:testAddNewGameMaster() (gas: 157618) -Test_GameMasterEligibilityModule:testNewModuleSetup() (gas: 135955) -Test_GameMasterEligibilityModule:testRemoveGameMaster() (gas: 92316) \ No newline at end of file +ItemsTest:testClaimItem() (gas: 867826) +ItemsTest:testClaimItemRevert() (gas: 1254250) +ItemsTest:testComplexRequirementsClaimRevert() (gas: 1216332) +ItemsTest:testComplexRequirementsClaimRevertWithTooMuchExp() (gas: 1245922) +ItemsTest:testComplexRequirementsClaimWithItem1() (gas: 1292634) +ItemsTest:testComplexRequirementsClaimWithItem1ForShallowNot() (gas: 1252520) +ItemsTest:testComplexRequirementsClaimWithItem2() (gas: 1297492) +ItemsTest:testCraftItem() (gas: 697382) +ItemsTest:testCraftItemRevert() (gas: 429801) +ItemsTest:testCreateClaimableItem() (gas: 74702) +ItemsTest:testCreateCraftableItem() (gas: 67129) +ItemsTest:testCreateItemTypeRevert() (gas: 62951) +ItemsTest:testDeleteItem() (gas: 237185) +ItemsTest:testDismantleItems() (gas: 1156518) +ItemsTest:testDismantleItemsRevert() (gas: 1215030) +ItemsTest:testDropLoot() (gas: 1238154) +ItemsTest:testDropLootRevert() (gas: 256152) +ItemsTest:testInvalidTreeAnd() (gas: 607887) +ItemsTest:testInvalidTreeNot() (gas: 819048) +ItemsTest:testInvalidTreeOr() (gas: 836082) +ItemsTest:testSimpleRequirementsClaimWithItem1() (gas: 620886) +ItemsTest:testURI() (gas: 20043) +ItemsTest:testUpdateClaimableItemRequirements() (gas: 322833) +ItemsTest:testUpdateCraftableItemRequirements() (gas: 191727) +Test_AdminEligibilityModule:testAddNewAdmin() (gas: 142497) +Test_AdminEligibilityModule:testRemoveAdmin() (gas: 122833) +Test_ElderEligibilityModule:testAddClassToElderModule() (gas: 462184) +Test_ElderEligibilityModule:testCharacterSheetsLevelEligibilityModule() (gas: 655299) +Test_ElderEligibilityModule:testElderModuleNoCharacter() (gas: 469090) +Test_GameMasterEligibilityModule:testAddNewGameMaster() (gas: 155805) +Test_GameMasterEligibilityModule:testNewModuleSetup() (gas: 133928) +Test_GameMasterEligibilityModule:testRemoveGameMaster() (gas: 90849) \ No newline at end of file diff --git a/Makefile b/Makefile index 4c2557c..aefcbeb 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,15 @@ deploy :; verify :; ./scripts/verify.sh ${network} ${contract} CONTRACTS = \ +CharacterAccount \ +CharacterSheetsImplementation \ +ExperienceImplementation \ +ItemsImplementation \ +ItemsManagerImplementation \ +ClassesImplementation \ +MolochV2EligibilityAdaptor \ +MolochV3EligibilityAdaptor \ +ClassLevelAdaptor \ HatsAdaptor \ CharacterSheetsLevelEligibilityModule \ ERC6551HatsEligibilityModule \ @@ -52,7 +61,6 @@ ClonesAddressStorageImplementation \ ImplementationAddressStorage \ CharacterSheetsFactory - deploy-contracts :; @for contract in ${CONTRACTS}; do \ make deploy network=${network} force=${force} contract=$$contract; \ diff --git a/addresses.json b/addresses.json index 1689d7b..cfa4d7b 100644 --- a/addresses.json +++ b/addresses.json @@ -3,112 +3,101 @@ "chainId": "100", "network": "gnosis", "Erc6551Registry": "0x02101dfB77FDE026414827Fdc604ddAF224F0921", - "Dao": "0xfe1084bC16427e5EB7f13Fc19bCD4E641F7d571f", - "CharacterAccount": "0xe12974EaCB122b098165396DC16dF433017111ca", - "CharacterSheetsImplementation": "0xB4BcAb0a8F7dAe2757e52a0b77346a089832A6FC", - "ClassesImplementation": "0x6be4FA764062c6455223a5bE50aEaEA8CEB7009C", - "CharacterSheetsFactory": "0x734f6333ADbE88064a5fFdEbb487f59063Ba4068", - "ClassLevelAdaptor": "0x8aBcdc5B54f8F85eAB5eE21EF4123a78dEd24E6a", - "HatsAdaptor": "0xBe7A3fcE59A44F9a025352F2e0f6e7a97e4b83a9", - "CharacterSheetsLevelEligibilityModule": "0xB2Ad134eB41695Ca87a62C7529259dC271d810Ce", - "AddressHatsEligibilityModule": "0x9AaF0df5657b634131784523F4F5e83459c61986", + "AllowListHatsEligibilityModule": "0xaC208e6668DE569C6ea1db76DeCea70430335Ed5", "ERC721HatsEligibilityModule": "0xF37cf12fB4493D29270806e826fDDf50dd722bab", - "ERC6551HatsEligibilityModule": "0x36C55610d6043703bF7Ae29a8aa5768FC4772738", - "MultiERC6511HatsEligibilityModule": "", - "ExperienceImplementation": "0x66467555734aa5E89336DD99822DfF9Dcf09bAd7", - "ItemsManagerImplementation": "0x2355D357164F64dAb43A776aE7637d35B61E9a53", - "ClonesAddressStorage": "", - "ImplementationAddressStorage": "0xB554A4Cc89047419cf8Eb6230d6fea6Fd37C6c42", - "ItemsImplementation": "0x19386B06d2182a25CfB90b283Ec2F226BFf08389", "HatsContract": "0x3bc1A0Ad72417f2d411118085256fC53CBdDd137", "HatsModuleFactory": "0x0a3f85fa597B6a967271286aA0724811acDF5CD9", - "MolochV2EligibilityAdaptor": "0x465887988A5542fFD9252985Efa0C0e2341Df741", - "MolochV3EligibilityAdaptor": "0x620646b1E1b27b56afDaf87eE13CA727F4E87cC8", - "ClonesAddressStorageImplementation": "0x20C270dD8F5F8A341AA90fB8Eb0B3bc44237cc29" + "CharacterAccount": "0x936aa7A9882725D6678751BCe43b834cFEB104d6", + "CharacterSheetsImplementation": "0xF925c147EB2d829693Dbd396ECFe0370627e7513", + "ExperienceImplementation": "0xd4d0f703a1B1205EC1a6C45499d2a8b7292B726c", + "ItemsImplementation": "0x6605D4F26e87b0bc034e5A059B448509bEd45577", + "ItemsManagerImplementation": "0x473017Ee3dF48C194f19688d39Cb9a83903A9CeF", + "ClassesImplementation": "0x6db7DF9a3bdF2c2dF76CA679f5954CCF88a34D94", + "MolochV2EligibilityAdaptor": "0x993c409E0f37238b97F45fe2D6223D8e3118d498", + "MolochV3EligibilityAdaptor": "0xFb38767DD77Ab247AA71F51774e0d9BdfC0238b3", + "ClassLevelAdaptor": "0x9888797415B7d5a976325972b3585bC1bbc390F3", + "HatsAdaptor": "0x966A24e86A6F4fe47C07A442bdA636Ae19cd9a50", + "CharacterSheetsLevelEligibilityModule": "0x6c904AF082FB429f5389278923EBA0Fe9dd59dc4", + "ERC6551HatsEligibilityModule": "0x2FB64E7cC67466f9dAA627c893D47AF3E42b06A9", + "MultiERC6551HatsEligibilityModule": "0x5a1551E7821eE6c56108761c301382B89f7bb08d", + "ClonesAddressStorageImplementation": "0x5768c8B53930C3971357c78EF91C1Edf33F4b1B3", + "ImplementationAddressStorage": "0x691bC3C2e87D00638776CC3740141C4150Bf02eF", + "CharacterSheetsFactory": "0xC31cd47907ED2C2693182506Df6437d9151f37a6" }, "optimism": { "chainId": "10", "network": "optimism", "Erc6551Registry": "0x02101dfB77FDE026414827Fdc604ddAF224F0921", - "Dao": "", - "CharacterAccount": "", - "CharacterSheetsImplementation": "", - "ClassesImplementation": "", - "CharacterSheetsFactory": "", - "ClassLevelAdaptor": "", - "HatsAdaptor": "", - "CharacterSheetsLevelEligibilityModule": "", - "AddressHatsEligibilityModule": "0x9AaF0df5657b634131784523F4F5e83459c61986", "AllowListHatsEligibilityModule": "0xaC208e6668DE569C6ea1db76DeCea70430335Ed5", "ERC721HatsEligibilityModule": "0xF37cf12fB4493D29270806e826fDDf50dd722bab", - "ERC6551HatsEligibilityModule": "0x36C55610d6043703bF7Ae29a8aa5768FC4772738", - "MultiERC6511HatsEligibilityModule": "", - "ExperienceImplementation": "", - "ItemsManagerImplementation": "", - "ClonesAddressStorage": "", - "ImplementationAddressStorage": "", - "ItemsImplementation": "", "HatsContract": "0x3bc1A0Ad72417f2d411118085256fC53CBdDd137", "HatsModuleFactory": "0x0a3f85fa597B6a967271286aA0724811acDF5CD9", - "MolochV2EligibilityAdaptor": "", - "MolochV3EligibilityAdaptor": "", - "ClonesAddressStorageImplementation": "" + "CharacterAccount": "0x936aa7A9882725D6678751BCe43b834cFEB104d6", + "CharacterSheetsImplementation": "0xF925c147EB2d829693Dbd396ECFe0370627e7513", + "ExperienceImplementation": "0xd4d0f703a1B1205EC1a6C45499d2a8b7292B726c", + "ItemsImplementation": "0x6605D4F26e87b0bc034e5A059B448509bEd45577", + "ItemsManagerImplementation": "0x473017Ee3dF48C194f19688d39Cb9a83903A9CeF", + "ClassesImplementation": "0x6db7DF9a3bdF2c2dF76CA679f5954CCF88a34D94", + "MolochV2EligibilityAdaptor": "0x993c409E0f37238b97F45fe2D6223D8e3118d498", + "MolochV3EligibilityAdaptor": "0xFb38767DD77Ab247AA71F51774e0d9BdfC0238b3", + "ClassLevelAdaptor": "0x9888797415B7d5a976325972b3585bC1bbc390F3", + "HatsAdaptor": "0x966A24e86A6F4fe47C07A442bdA636Ae19cd9a50", + "CharacterSheetsLevelEligibilityModule": "0x6c904AF082FB429f5389278923EBA0Fe9dd59dc4", + "ERC6551HatsEligibilityModule": "0x2FB64E7cC67466f9dAA627c893D47AF3E42b06A9", + "MultiERC6551HatsEligibilityModule": "0x5a1551E7821eE6c56108761c301382B89f7bb08d", + "ClonesAddressStorageImplementation": "0x5768c8B53930C3971357c78EF91C1Edf33F4b1B3", + "ImplementationAddressStorage": "0x691bC3C2e87D00638776CC3740141C4150Bf02eF", + "CharacterSheetsFactory": "0xC31cd47907ED2C2693182506Df6437d9151f37a6" }, "base": { "chainId": "8453", "network": "base", "Erc6551Registry": "0x02101dfB77FDE026414827Fdc604ddAF224F0921", - "Dao": "", - "CharacterAccount": "", - "CharacterSheetsImplementation": "", - "ClassesImplementation": "", - "CharacterSheetsFactory": "", - "ClassLevelAdaptor": "", - "HatsAdaptor": "", - "CharacterSheetsLevelEligibilityModule": "", - "AddressHatsEligibilityModule": "0x9AaF0df5657b634131784523F4F5e83459c61986", "AllowListHatsEligibilityModule": "0xaC208e6668DE569C6ea1db76DeCea70430335Ed5", "ERC721HatsEligibilityModule": "0xF37cf12fB4493D29270806e826fDDf50dd722bab", - "ERC6551HatsEligibilityModule": "", - "MultiERC6511HatsEligibilityModule": "", - "ExperienceImplementation": "", - "ItemsManagerImplementation": "", - "ClonesAddressStorage": "", - "ImplementationAddressStorage": "", - "ItemsImplementation": "", "HatsContract": "0x3bc1A0Ad72417f2d411118085256fC53CBdDd137", "HatsModuleFactory": "0x0a3f85fa597B6a967271286aA0724811acDF5CD9", - "MolochV2EligibilityAdaptor": "", - "MolochV3EligibilityAdaptor": "", - "ClonesAddressStorageImplementation": "" + "CharacterAccount": "0x936aa7A9882725D6678751BCe43b834cFEB104d6", + "CharacterSheetsImplementation": "0xF925c147EB2d829693Dbd396ECFe0370627e7513", + "ExperienceImplementation": "0xd4d0f703a1B1205EC1a6C45499d2a8b7292B726c", + "ItemsImplementation": "0x6605D4F26e87b0bc034e5A059B448509bEd45577", + "ItemsManagerImplementation": "0x473017Ee3dF48C194f19688d39Cb9a83903A9CeF", + "ClassesImplementation": "0x6db7DF9a3bdF2c2dF76CA679f5954CCF88a34D94", + "MolochV2EligibilityAdaptor": "0x993c409E0f37238b97F45fe2D6223D8e3118d498", + "MolochV3EligibilityAdaptor": "0xFb38767DD77Ab247AA71F51774e0d9BdfC0238b3", + "ClassLevelAdaptor": "0x9888797415B7d5a976325972b3585bC1bbc390F3", + "HatsAdaptor": "0x966A24e86A6F4fe47C07A442bdA636Ae19cd9a50", + "CharacterSheetsLevelEligibilityModule": "0x6c904AF082FB429f5389278923EBA0Fe9dd59dc4", + "ERC6551HatsEligibilityModule": "0x2FB64E7cC67466f9dAA627c893D47AF3E42b06A9", + "MultiERC6551HatsEligibilityModule": "0x5a1551E7821eE6c56108761c301382B89f7bb08d", + "ClonesAddressStorageImplementation": "0x5768c8B53930C3971357c78EF91C1Edf33F4b1B3", + "ImplementationAddressStorage": "0x691bC3C2e87D00638776CC3740141C4150Bf02eF", + "CharacterSheetsFactory": "0xC31cd47907ED2C2693182506Df6437d9151f37a6" }, "polygon": { "chainId": "137", "network": "polygon", "Erc6551Registry": "0x02101dfB77FDE026414827Fdc604ddAF224F0921", - "Dao": "", - "CharacterAccount": "", - "CharacterSheetsImplementation": "", - "ClassesImplementation": "", - "CharacterSheetsFactory": "", - "ClassLevelAdaptor": "", - "HatsAdaptor": "", - "CharacterSheetsLevelEligibilityModule": "", - "AddressHatsEligibilityModule": "0x9AaF0df5657b634131784523F4F5e83459c61986", "AllowListHatsEligibilityModule": "0xaC208e6668DE569C6ea1db76DeCea70430335Ed5", "ERC721HatsEligibilityModule": "0xF37cf12fB4493D29270806e826fDDf50dd722bab", - "ERC6551HatsEligibilityModule": "", - "MultiERC6511HatsEligibilityModule": "", - "ExperienceImplementation": "", - "ItemsManagerImplementation": "", - "ClonesAddressStorage": "", - "ImplementationAddressStorage": "", - "ItemsImplementation": "", "HatsContract": "0x3bc1A0Ad72417f2d411118085256fC53CBdDd137", "HatsModuleFactory": "0x0a3f85fa597B6a967271286aA0724811acDF5CD9", - "MolochV2EligibilityAdaptor": "", - "MolochV3EligibilityAdaptor": "", - "ClonesAddressStorageImplementation": "" + "ERC6551HatsEligibilityModule": "0x2FB64E7cC67466f9dAA627c893D47AF3E42b06A9", + "CharacterAccount": "0x936aa7A9882725D6678751BCe43b834cFEB104d6", + "CharacterSheetsImplementation": "0xF925c147EB2d829693Dbd396ECFe0370627e7513", + "ExperienceImplementation": "0xd4d0f703a1B1205EC1a6C45499d2a8b7292B726c", + "ItemsImplementation": "0x6605D4F26e87b0bc034e5A059B448509bEd45577", + "ItemsManagerImplementation": "0x473017Ee3dF48C194f19688d39Cb9a83903A9CeF", + "ClassesImplementation": "0x6db7DF9a3bdF2c2dF76CA679f5954CCF88a34D94", + "MolochV2EligibilityAdaptor": "0x993c409E0f37238b97F45fe2D6223D8e3118d498", + "MolochV3EligibilityAdaptor": "0xFb38767DD77Ab247AA71F51774e0d9BdfC0238b3", + "HatsAdaptor": "0x966A24e86A6F4fe47C07A442bdA636Ae19cd9a50", + "CharacterSheetsLevelEligibilityModule": "0x6c904AF082FB429f5389278923EBA0Fe9dd59dc4", + "ClassLevelAdaptor": "0x9888797415B7d5a976325972b3585bC1bbc390F3", + "MultiERC6551HatsEligibilityModule": "0x5a1551E7821eE6c56108761c301382B89f7bb08d", + "ClonesAddressStorageImplementation": "0x5768c8B53930C3971357c78EF91C1Edf33F4b1B3", + "ImplementationAddressStorage": "0x691bC3C2e87D00638776CC3740141C4150Bf02eF", + "CharacterSheetsFactory": "0xC31cd47907ED2C2693182506Df6437d9151f37a6" }, "sepolia": { "chainId": "11155111", @@ -132,34 +121,32 @@ "ERC6551HatsEligibilityModule": "0x2FB64E7cC67466f9dAA627c893D47AF3E42b06A9", "MultiERC6551HatsEligibilityModule": "0x5a1551E7821eE6c56108761c301382B89f7bb08d", "ClonesAddressStorageImplementation": "0x5768c8B53930C3971357c78EF91C1Edf33F4b1B3", - "ImplementationAddressStorage": "0xEd3551A9A4807134C568EFa7D2Db6f3C66558179", + "ImplementationAddressStorage": "0x691bC3C2e87D00638776CC3740141C4150Bf02eF", "CharacterSheetsFactory": "0xC31cd47907ED2C2693182506Df6437d9151f37a6" }, "anvil": { "chainId": "31337", "network": "anvil", "Erc6551Registry": "0x02101dfB77FDE026414827Fdc604ddAF224F0921", + "AllowListHatsEligibilityModule": "0xaC208e6668DE569C6ea1db76DeCea70430335Ed5", + "ERC721HatsEligibilityModule": "0xF37cf12fB4493D29270806e826fDDf50dd722bab", "HatsContract": "0x3bc1A0Ad72417f2d411118085256fC53CBdDd137", "HatsModuleFactory": "0x0a3f85fa597B6a967271286aA0724811acDF5CD9", - "Erc6551RegistryOld": "0x4e59b44847b379578588920ca78fbf26c0b4956c", - "CharacterAccount": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512", - "ExperienceImplementation": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", - "ItemsImplementation": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9", - "ItemsManagerImplementation": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707", - "CharacterSheetsImplementation": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0", - "ClassesImplementation": "0x0165878A594ca255338adfa4d48449f69242Eb8F", - "MolochV2EligibilityAdaptor": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853", - "MolochV3EligibilityAdaptor": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6", - "ClassLevelAdaptor": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318", - "HatsAdaptor": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788", - "AdminHatEligibilityModule": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e", - "ClonesAddressStorageImplementation": "0x0B306BF915C4d645ff596e518fAf3F9669b97016", - "ImplementationAddressStorage": "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1", - "CharacterSheetsFactory": "0x68B1D87F95878fE05B998F19b66F4baba5De1aed", - "AddressHatsEligibilityModule": "0x9AaF0df5657b634131784523F4F5e83459c61986", - "CharacterSheetsLevelEligibilityModule": "", - "ERC721HatsEligibilityModule": "0x6bAa65D3E024D8ebA717085691dd8A985e9F267E", - "ERC6551HatsEligibilityModule": "", - "MultiERC6511HatsEligibilityModule": "" + "CharacterAccount": "0x936aa7A9882725D6678751BCe43b834cFEB104d6", + "CharacterSheetsImplementation": "0xF925c147EB2d829693Dbd396ECFe0370627e7513", + "ExperienceImplementation": "0xd4d0f703a1B1205EC1a6C45499d2a8b7292B726c", + "ItemsImplementation": "0x6605D4F26e87b0bc034e5A059B448509bEd45577", + "ItemsManagerImplementation": "0x473017Ee3dF48C194f19688d39Cb9a83903A9CeF", + "ClassesImplementation": "0x6db7DF9a3bdF2c2dF76CA679f5954CCF88a34D94", + "MolochV2EligibilityAdaptor": "0x993c409E0f37238b97F45fe2D6223D8e3118d498", + "MolochV3EligibilityAdaptor": "0xFb38767DD77Ab247AA71F51774e0d9BdfC0238b3", + "ClassLevelAdaptor": "0x9888797415B7d5a976325972b3585bC1bbc390F3", + "HatsAdaptor": "0x966A24e86A6F4fe47C07A442bdA636Ae19cd9a50", + "CharacterSheetsLevelEligibilityModule": "0x6c904AF082FB429f5389278923EBA0Fe9dd59dc4", + "ERC6551HatsEligibilityModule": "0x2FB64E7cC67466f9dAA627c893D47AF3E42b06A9", + "MultiERC6551HatsEligibilityModule": "0x5a1551E7821eE6c56108761c301382B89f7bb08d", + "ClonesAddressStorageImplementation": "0x5768c8B53930C3971357c78EF91C1Edf33F4b1B3", + "ImplementationAddressStorage": "0x691bC3C2e87D00638776CC3740141C4150Bf02eF", + "CharacterSheetsFactory": "0xC31cd47907ED2C2693182506Df6437d9151f37a6" } } diff --git a/foundry.toml b/foundry.toml index 747ef3d..38f76a9 100644 --- a/foundry.toml +++ b/foundry.toml @@ -31,13 +31,16 @@ [rpc_endpoints] gnosis = "${GNOSIS_RPC_URL}" sepolia = "${SEPOLIA_RPC_URL}" - goerli = "${GOERLI_RPC_URL}" + polygon = "${POLYGON_RPC_URL}" + optimism = "${OPTIMISM_RPC_URL}" + base = "${BASE_RPC_URL}" [etherscan] arbitrum = { key = "${ARBISCAN_API_KEY}" } - goerli = { key = "${ETHERSCAN_API_KEY}" } mainnet = { key = "${ETHERSCAN_API_KEY}" } optimism = { key = "${OPTIMISTIC_ETHERSCAN_API_KEY}" } - polygon = { key = "${POLYGONSCAN_API_KEY}" } + polygon = { key = "${POLYGONSCAN_API_KEY}", url = "https://api.polygonscan.com/api/" } sepolia = { key = "${ETHERSCAN_API_KEY}" } gnosis = { key = "${GNOSISSCAN_API_KEY}", url = "https://api.gnosisscan.io/api/" } + base = { key = "${BASESCAN_API_KEY}", url = "https://api.basescan.org/api/" } + diff --git a/scripts/ImplementationAddressStorage.s.sol b/scripts/ImplementationAddressStorage.s.sol index f574a54..034b19d 100644 --- a/scripts/ImplementationAddressStorage.s.sol +++ b/scripts/ImplementationAddressStorage.s.sol @@ -29,8 +29,8 @@ struct HatsAddresses { //eligibility modules address allowListHatsEligibilityModule; address erc721HatsEligibilityModule; - address erc6551HatsEligitbilityModule; - address multiErc6551HatsEligitbilityModule; + address erc6551HatsEligibilityModule; + address multiErc6551HatsEligibilityModule; address erc6551Registry; } @@ -52,7 +52,7 @@ struct HatsAddresses { * _implementationsAddresses.allowListHatsEligibilityModule, * _implementationsAddresses.gameMasterHatsEligibilityModule, * _implementationsAddresses.erc721HatsEligibilityModule, - * _implementationsAddresses.erc6551HatsEligitbilityModule, + * _implementationsAddresses.erc6551HatsEligibilityModule, * _implementationsAddresses.hatsAdaptorImplementation, * _implementationsAddresses.characterEligibilityAdaptorImplementation, * _implementationsAddresses.classLevelAdaptorImplementation @@ -129,9 +129,9 @@ contract DeployImplementationAddressStorage is BaseDeployer { json.readAddress(string(abi.encodePacked(".", targetEnv, ".AllowListHatsEligibilityModule"))); hatsAddresses.erc721HatsEligibilityModule = json.readAddress(string(abi.encodePacked(".", targetEnv, ".ERC721HatsEligibilityModule"))); - hatsAddresses.erc6551HatsEligitbilityModule = + hatsAddresses.erc6551HatsEligibilityModule = json.readAddress(string(abi.encodePacked(".", targetEnv, ".ERC6551HatsEligibilityModule"))); - hatsAddresses.multiErc6551HatsEligitbilityModule = + hatsAddresses.multiErc6551HatsEligibilityModule = json.readAddress(string(abi.encodePacked(".", targetEnv, ".MultiERC6551HatsEligibilityModule"))); } @@ -176,8 +176,8 @@ contract DeployImplementationAddressStorage is BaseDeployer { bytes memory encodedModuleAddresses = abi.encode( hatsAddresses.allowListHatsEligibilityModule, hatsAddresses.erc721HatsEligibilityModule, - hatsAddresses.erc6551HatsEligitbilityModule, - hatsAddresses.multiErc6551HatsEligitbilityModule + hatsAddresses.erc6551HatsEligibilityModule, + hatsAddresses.multiErc6551HatsEligibilityModule ); return encodedModuleAddresses; diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 7a7ee72..69d093a 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -55,7 +55,8 @@ if [[ $SAVED_ADDRESS != "" && $FORCE == false ]]; then fi if [[ $1 == "anvil" ]]; then - PRIVATE_KEY="ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" + MNEMONIC="" + PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" NETWORK="http://localhost:8545" fi @@ -78,15 +79,16 @@ else exit 0 fi -echo "Deployment completed: $DEPLOYED_ADDRESS" -echo "Transaction hash: $TX_HASH" echo "" - if [[ $DEPLOYED_ADDRESS == "" || $TX_HASH == "" ]]; then - echo "Deployment failed. Exiting script" + echo "Deployment failed or already deployed. Exiting script" exit 1 fi +echo "Deployment completed: $DEPLOYED_ADDRESS" +echo "Transaction hash: $TX_HASH" +echo "" + node scripts/helpers/saveAddress.js $1 $2 $DEPLOYED_ADDRESS VERIFY=false @@ -94,7 +96,7 @@ if [[ $3 == "--verify" || $4 == "--verify" ]]; then VERIFY=true fi -if [[ $VERIFY == false || $NETWORK == "anvil" ]]; then +if [[ $VERIFY == false || $1 == "anvil" ]]; then echo "Skipping verification" exit 0 fi @@ -129,6 +131,20 @@ if [[ $NETWORK == "gnosis" ]]; then export VERIFIER_URL="https://api.gnosisscan.io/api/" fi +if [[ $NETWORK == "polygon" ]]; then + API_KEY=$POLYGONSCAN_API_KEY + export VERIFIER_URL="https://api.polygonscan.com/api/" +fi + +if [[ $NETWORK == "optimism" ]]; then + API_KEY=$OPTIMISTIC_ETHERSCAN_API_KEY + export VERIFIER_URL="https://api-optimistic.etherscan.io/api/" +fi + +if [[ $NETWORK == "base" ]]; then + API_KEY=$BASESCAN_API_KEY + export VERIFIER_URL="https://api.basescan.org/api/" +fi if [[ $2 == *"Implementation" ]]; then forge verify-contract --watch --chain-id $CHAIN_ID --compiler-version v0.8.25+commit.b61c2a91 --etherscan-api-key $API_KEY --num-of-optimizations 20000 $DEPLOYED_ADDRESS src/implementations/$2.sol:$2 diff --git a/scripts/verify.sh b/scripts/verify.sh index cd3dca1..121a573 100755 --- a/scripts/verify.sh +++ b/scripts/verify.sh @@ -72,6 +72,22 @@ if [[ $NETWORK == "gnosis" ]]; then export VERIFIER_URL="https://api.gnosisscan.io/api/" fi +if [[ $NETWORK == "polygon" ]]; then + API_KEY=$POLYGONSCAN_API_KEY + export VERIFIER_URL="https://api.polygonscan.com/api/" +fi + +if [[ $NETWORK == "optimism" ]]; then + API_KEY=$OPTIMISTIC_ETHERSCAN_API_KEY + export VERIFIER_URL="https://api-optimistic.etherscan.io/api/" +fi + +if [[ $NETWORK == "base" ]]; then + API_KEY=$BASESCAN_API_KEY + export VERIFIER_URL="https://api.basescan.org/api/" +fi + + if [[ $2 == *"Implementation" ]]; then forge verify-contract --watch --chain-id $CHAIN_ID --compiler-version v0.8.25+commit.b61c2a91 --etherscan-api-key $API_KEY --num-of-optimizations 20000 $SAVED_ADDRESS src/implementations/$2.sol:$2 elif [[ $2 == *"Adaptor" ]]; then diff --git a/src/ImplementationAddressStorage.sol b/src/ImplementationAddressStorage.sol index 655597d..177c5ff 100644 --- a/src/ImplementationAddressStorage.sol +++ b/src/ImplementationAddressStorage.sol @@ -243,8 +243,9 @@ contract ImplementationAddressStorage is Initializable, OwnableUpgradeable { ( _implementationsAddresses.addressHatsEligibilityModule, _implementationsAddresses.erc721HatsEligibilityModule, - _implementationsAddresses.erc6551HatsEligibilityModule - ) = abi.decode(encodedModuleAddresses, (address, address, address)); + _implementationsAddresses.erc6551HatsEligibilityModule, + _implementationsAddresses.multiERC6551HatsEligibilityModule + ) = abi.decode(encodedModuleAddresses, (address, address, address, address)); } function _initAdaptors(bytes calldata encodedAdaptorAddresses) internal {