@artblocks/contracts 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/README.md +11 -10
  2. package/artifacts/contracts/AdminACLV0RoyaltyRegistry.sol/AdminACLV0RoyaltyRegistry.json +193 -0
  3. package/artifacts/contracts/AdminACLV0RoyaltyRegistry.sol/IRoyaltyRegistry.json +35 -0
  4. package/artifacts/contracts/AdminACLV1.sol/AdminACLV1.json +2 -2
  5. package/artifacts/contracts/BytecodeStorageReaders/BytecodeStorageReaderContractV2.sol/BytecodeStorageReaderContractV2.json +2 -2
  6. package/artifacts/contracts/BytecodeStorageReaders/BytecodeStorageReaderContractV2_Web3Call.sol/BytecodeStorageReaderContractV2_Web3Call.json +2 -2
  7. package/artifacts/contracts/BytecodeStorageV2Writer.sol/BytecodeStorageV2Writer.json +2 -2
  8. package/artifacts/contracts/DependencyRegistryV0.sol/DependencyRegistryV0.json +210 -2
  9. package/artifacts/contracts/GenArt721CoreV3_Curated.sol/GenArt721CoreV3_Curated.json +235 -20
  10. package/artifacts/contracts/GenArt721CoreV3_Curated_Flex.sol/GenArt721CoreV3_Curated_Flex.json +3197 -0
  11. package/artifacts/contracts/GenArt721CoreV3_Explorations_Flex.sol/GenArt721CoreV3_Explorations_Flex.json +3192 -0
  12. package/artifacts/contracts/OwnedCreate2FactoryV0.sol/OwnedCreate2FactoryV0.json +2 -2
  13. package/artifacts/contracts/archive/GenArt721CoreV3.sol/GenArt721CoreV3.json +27 -2
  14. package/artifacts/contracts/archive/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +27 -2
  15. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV2.sol/MinterDAExpV2.json +2 -2
  16. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV3.sol/MinterDAExpV3.json +2 -2
  17. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV4.sol/MinterDAExpV4.json +2 -2
  18. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol/MinterDAExpSettlementV0.json +2 -2
  19. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol/MinterDAExpSettlementV1.json +2 -2
  20. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +2 -2
  21. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV2.sol/MinterDALinV2.json +2 -2
  22. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV3.sol/MinterDALinV3.json +2 -2
  23. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV4.sol/MinterDALinV4.json +2 -2
  24. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV1.sol/MinterHolderV1.json +2 -2
  25. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV2.sol/MinterHolderV2.json +2 -2
  26. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV3.sol/MinterHolderV3.json +2 -2
  27. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV4.sol/MinterHolderV4.json +2 -2
  28. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV1.sol/MinterMerkleV1.json +2 -2
  29. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV2.sol/MinterMerkleV2.json +2 -2
  30. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV3.sol/MinterMerkleV3.json +2 -2
  31. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV4.sol/MinterMerkleV4.json +2 -2
  32. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV5.sol/MinterMerkleV5.json +2 -2
  33. package/artifacts/contracts/archive/minter-suite/Minters/MinterPolyptych/MinterPolyptychV0.sol/IGenArt721CoreContractV3WithRandomizer.json +25 -0
  34. package/artifacts/contracts/archive/minter-suite/Minters/MinterPolyptych/MinterPolyptychV0.sol/MinterPolyptychV0.json +2 -2
  35. package/artifacts/contracts/archive/minter-suite/Minters/MinterSEA/MinterSEAV0.sol/MinterSEAV0.json +2 -2
  36. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV2.sol/MinterSetPriceV2.json +2 -2
  37. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV3.sol/MinterSetPriceV3.json +2 -2
  38. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV4.sol/MinterSetPriceV4.json +2 -2
  39. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V2.sol/MinterSetPriceERC20V2.json +2 -2
  40. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V3.sol/MinterSetPriceERC20V3.json +2 -2
  41. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V4.sol/MinterSetPriceERC20V4.json +2 -2
  42. package/artifacts/contracts/engine/V3/EngineFactoryV0.sol/EngineFactoryV0.json +28 -2
  43. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +239 -20
  44. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +267 -48
  45. package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +27 -2
  46. package/artifacts/contracts/engine/V3/forks/PROHIBITION/AdminACLV0_PROHIBITION.sol/AdminACLV0_PROHIBITION.json +2 -2
  47. package/artifacts/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol/GenArt721CoreV3_Engine_Flex_PROHIBITION.json +27 -2
  48. package/artifacts/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.json +25 -0
  49. package/artifacts/contracts/engine/V3/transfer-hooks/AbstractTransferHook.sol/AbstractTransferHook.json +79 -0
  50. package/artifacts/contracts/engine/V3/transfer-hooks/OwnerHistoryTransferHook.sol/OwnerHistoryTransferHook.json +315 -0
  51. package/artifacts/contracts/generator/GenArt721GeneratorV0.sol/GenArt721GeneratorV0.json +2 -2
  52. package/artifacts/contracts/interfaces/v0.8.x/IClaimMinter.sol/IClaimMinter.json +189 -0
  53. package/artifacts/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +149 -0
  54. package/artifacts/contracts/interfaces/v0.8.x/IEngineFactoryV0.sol/IEngineFactoryV0.json +26 -0
  55. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3.sol/IGenArt721CoreContractV3.json +25 -0
  56. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol/IGenArt721CoreContractV3_Base.json +25 -0
  57. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol/IGenArt721CoreContractV3_Engine.json +123 -0
  58. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol/IGenArt721CoreContractV3_Engine_Flex.json +123 -0
  59. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.sol/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.json +25 -0
  60. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_PreV3p2.sol/IGenArt721CoreContractV3_Engine_PreV3p2.json +25 -0
  61. package/artifacts/contracts/interfaces/v0.8.x/IOwnerHistoryTransferHook.sol/IOwnerHistoryTransferHook.json +299 -0
  62. package/artifacts/contracts/interfaces/v0.8.x/IPMPV0.sol/IPMPV0.json +7 -1
  63. package/artifacts/contracts/interfaces/v0.8.x/ISRHooks.sol/ISRHooks.json +432 -0
  64. package/artifacts/contracts/interfaces/v0.8.x/ISeaDropShimForContract.sol/ISeaDropShimForContract.json +0 -13
  65. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterTieredAllowV0.sol/ISharedMinterTieredAllowV0.json +94 -0
  66. package/artifacts/contracts/interfaces/v0.8.x/ITransferHook.sol/ITransferHook.json +63 -0
  67. package/artifacts/contracts/libs/v0.8.x/AuthLib.sol/AuthLib.json +2 -2
  68. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV2.sol/BytecodeStorageReader.json +2 -2
  69. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV2.sol/BytecodeStorageWriter.json +2 -2
  70. package/artifacts/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol/DependencyRegistryStorageLib.json +2 -2
  71. package/artifacts/contracts/libs/v0.8.x/ENSLib.sol/ENSLib.json +10 -0
  72. package/artifacts/contracts/libs/v0.8.x/ENSLib.sol/IUniversalResolver.json +45 -0
  73. package/artifacts/contracts/libs/v0.8.x/EnumerableSetUint16.sol/EnumerableSetUint16.json +10 -0
  74. package/artifacts/contracts/libs/v0.8.x/FeistelWalkLib.sol/FeistelWalkLib.json +10 -0
  75. package/artifacts/contracts/libs/v0.8.x/ImmutableUint16Array.sol/ImmutableUint16Array.json +10 -0
  76. package/artifacts/contracts/libs/v0.8.x/V3EngineLib.sol/V3EngineLib.json +163 -0
  77. package/artifacts/contracts/libs/v0.8.x/V3FlexLib.sol/V3FlexLib.json +2 -2
  78. package/artifacts/contracts/libs/v0.8.x/V3TransferHookLib.sol/V3TransferHookLib.json +79 -0
  79. package/artifacts/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol/MaxInvocationsLib.json +2 -2
  80. package/artifacts/contracts/libs/v0.8.x/minter-libs/OnChainAllowlistLib.sol/OnChainAllowlistLib.json +10 -0
  81. package/artifacts/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol/PolyptychLib.json +2 -2
  82. package/artifacts/contracts/libs/v0.8.x/minter-libs/RAMLib.sol/RAMLib.json +2 -2
  83. package/artifacts/contracts/libs/v0.8.x/minter-libs/SEALib.sol/SEALib.json +2 -2
  84. package/artifacts/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol/SettlementExpLib.json +2 -2
  85. package/artifacts/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol/SplitFundsLib.json +2 -2
  86. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
  87. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV2.sol/MinterFilterV2.json +2 -2
  88. package/artifacts/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol/MinterDAExpHolderV5.json +2 -2
  89. package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol/MinterDAExpSettlementV3.json +2 -2
  90. package/artifacts/contracts/minter-suite/Minters/MinterDAExpV5.sol/MinterDAExpV5.json +2 -2
  91. package/artifacts/contracts/minter-suite/Minters/MinterDALinHolderV5.sol/MinterDALinHolderV5.json +2 -2
  92. package/artifacts/contracts/minter-suite/Minters/MinterDALinV5.sol/MinterDALinV5.json +2 -2
  93. package/artifacts/contracts/minter-suite/Minters/MinterMinPriceMerkleV0.sol/MinterMinPriceMerkleV0.json +2 -2
  94. package/artifacts/contracts/minter-suite/Minters/MinterMinPriceV0.sol/MinterMinPriceV0.json +2 -2
  95. package/artifacts/contracts/minter-suite/Minters/MinterRAMV0.sol/MinterRAMV0.json +2 -2
  96. package/artifacts/contracts/minter-suite/Minters/MinterSEAV1.sol/MinterSEAV1.json +2 -2
  97. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol/MinterSetPriceERC20V5.json +2 -2
  98. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol/MinterSetPriceHolderV5.json +2 -2
  99. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol/MinterSetPriceMerkleV5.json +2 -2
  100. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceOnChainAllowV0.sol/MinterSetPriceOnChainAllowV0.json +522 -0
  101. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol/MinterSetPricePolyptychERC20V5.json +2 -2
  102. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol/MinterSetPricePolyptychV5.json +2 -2
  103. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceTieredAllowV1.sol/MinterSetPriceTieredAllowV1.json +715 -0
  104. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +2 -2
  105. package/artifacts/contracts/minter-suite/Minters/MinterSlidingScaleV0.sol/MinterSlidingScaleV0.json +431 -0
  106. package/artifacts/contracts/minter-suite/Minters/one-off/ClaimMinter.sol/ClaimMinter.json +502 -0
  107. package/artifacts/contracts/minter-suite/Minters/one-off/MinterSetPriceTieredOnChainAllowV0.sol/MinterSetPriceTieredOnChainAllowV0.json +673 -0
  108. package/artifacts/contracts/minter-suite/Minters/one-off/MinterSetPriceV5_SingleCore.sol/MinterSetPriceV5_SingleCore.json +2 -2
  109. package/artifacts/contracts/minter-suite/Minters/one-off/SeaDropXArtBlocksShim.sol/SeaDropXArtBlocksShim.json +6 -19
  110. package/artifacts/contracts/mock/BytecodeV2TextCR_DMock.sol/BytecodeV2TextCR_DMock.json +2 -2
  111. package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +2 -2
  112. package/artifacts/contracts/mock/ENSLibMock.sol/ENSLibMock.json +30 -0
  113. package/artifacts/contracts/mock/EnumerableSetUint16Mock.sol/EnumerableSetUint16Mock.json +146 -0
  114. package/artifacts/contracts/mock/FeistelWalkLibMock.sol/FeistelWalkLibMock.json +142 -0
  115. package/artifacts/contracts/mock/ForceSendMock.sol/ForceSendMock.json +2 -2
  116. package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +2 -2
  117. package/artifacts/contracts/mock/ImmutableUint16ArrayMock.sol/ImmutableUint16ArrayMock.json +89 -0
  118. package/artifacts/contracts/mock/MockAdminACLV0_PROHIBITION.sol/MockAdminACLV0Events_PROHIBITION.json +2 -2
  119. package/artifacts/contracts/mock/MockGenArt721V3Core.sol/MockGenArt721V3Core.json +490 -0
  120. package/artifacts/contracts/mock/MockPMP.sol/MockPMP.json +523 -0
  121. package/artifacts/contracts/mock/MockPMPAugmentHook.sol/MockPMPAugmentHook.json +2 -2
  122. package/artifacts/contracts/mock/MockPMPConfigureHook.sol/MockPMPConfigureHook.json +2 -2
  123. package/artifacts/contracts/mock/MockTransferHook.sol/MockTransferHook.json +453 -0
  124. package/artifacts/contracts/mock/MockTransferHookTestHelpers.sol/MockBatchTransferrer.json +39 -0
  125. package/artifacts/contracts/mock/MockTransferHookTestHelpers.sol/MockForwardingERC721Receiver.json +71 -0
  126. package/artifacts/contracts/mock/MockTransferHookTestHelpers.sol/MockSpoofingCore.json +94 -0
  127. package/artifacts/contracts/mock/RandomizerV2_NoAssignMock.sol/RandomizerV2_NoAssignMock.json +2 -2
  128. package/artifacts/contracts/mock/ReentrancyBatchMockShared.sol/IBatchMinter.json +64 -0
  129. package/artifacts/contracts/mock/ReentrancyBatchMockShared.sol/ReentrancyBatchMockShared.json +113 -0
  130. package/artifacts/contracts/mock/RelayExecutorTestHelper.sol/MockTarget.json +74 -0
  131. package/artifacts/contracts/mock/RelayExecutorTestHelper.sol/RelayExecutorPartialRevertsTestHelper.json +138 -0
  132. package/artifacts/contracts/mock/RelayExecutorTestHelper.sol/RelayExecutorTestHelper.json +119 -0
  133. package/artifacts/contracts/randomizer/deprecated/PolyptychRandomizerV0.sol/BasicPolyptychRandomizerV0.json +2 -2
  134. package/artifacts/contracts/randomizer/deprecated/RandomizerV2.sol/BasicRandomizerV2.json +2 -2
  135. package/artifacts/contracts/randomizer/shared/SharedRandomizerV0.sol/SharedRandomizerV0.json +2 -2
  136. package/artifacts/contracts/relay/RelayExecutor.sol/RelayExecutor.json +101 -0
  137. package/artifacts/contracts/relay/RelayExecutorPartialReverts.sol/RelayExecutorPartialReverts.json +120 -0
  138. package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverrideSplits.sol/GenArt721RoyaltyOverrideSplits.json +263 -0
  139. package/artifacts/contracts/utils/MintMulticallUtil.sol/IMinterSetPriceV5.json +40 -0
  140. package/artifacts/contracts/utils/MintMulticallUtil.sol/MintMulticallUtil.json +163 -0
  141. package/artifacts/contracts/web3call/PMPV0.sol/PMPV0.json +9 -3
  142. package/artifacts/contracts/web3call/PMPV1.sol/PMPV1.json +648 -0
  143. package/artifacts/contracts/web3call/augment-hooks/InjectBaseGasFee.sol/InjectBaseGasFee.json +2 -2
  144. package/artifacts/contracts/web3call/augment-hooks/InjectBlockHeight.sol/InjectBlockHeight.json +83 -0
  145. package/artifacts/contracts/web3call/augment-hooks/InjectBlockHeightAndArtistProjectOverrides.sol/InjectBlockHeightAndArtistProjectOverrides.json +226 -0
  146. package/artifacts/contracts/web3call/augment-hooks/InjectBlockHeightAndNumOwnedProjectTokens.sol/InjectBlockHeightAndNumOwnedProjectTokens.json +182 -0
  147. package/artifacts/contracts/web3call/augment-hooks/InjectBlockHeightProjectInvocationsAndArtistProjectOverrides.sol/InjectBlockHeightProjectInvocationsAndArtistProjectOverrides.json +226 -0
  148. package/artifacts/contracts/web3call/augment-hooks/InjectBlockTimestamp.sol/InjectBlockTimestamp.json +83 -0
  149. package/artifacts/contracts/web3call/augment-hooks/InjectBytesPerToken.sol/InjectBytesPerToken.json +358 -0
  150. package/artifacts/contracts/web3call/augment-hooks/InjectChromieSquiggleFloorPrice.sol/InjectChromieSquiggleFloorPrice.json +2 -2
  151. package/artifacts/contracts/web3call/augment-hooks/InjectIsNounsDaoMember.sol/InjectIsNounsDaoMember.json +2 -2
  152. package/artifacts/contracts/web3call/augment-hooks/InjectIsProjectFullyMinted.sol/InjectIsProjectFullyMinted.json +2 -2
  153. package/artifacts/contracts/web3call/augment-hooks/InjectPolyptychTokenHash.sol/InjectPolyptychTokenHash.json +2 -2
  154. package/artifacts/contracts/web3call/augment-hooks/InjectTokenHashSeed.sol/InjectTokenHashSeed.json +2 -2
  155. package/artifacts/contracts/web3call/augment-hooks/InjectTokenOwner.sol/InjectTokenOwner.json +2 -2
  156. package/artifacts/contracts/web3call/augment-hooks/InjectTokenOwnerEthBalance.sol/InjectTokenOwnerEthBalance.json +2 -2
  157. package/artifacts/contracts/web3call/augment-hooks/InjectUSDCTotalSupply.sol/InjectUSDCTotalSupply.json +2 -2
  158. package/artifacts/contracts/web3call/augment-hooks/SRHooks.sol/SRHooks.json +899 -0
  159. package/artifacts/contracts/web3call/combined-hooks/LiftHooks.sol/IGenArt721V0_Minimal.json +30 -0
  160. package/artifacts/contracts/web3call/combined-hooks/LiftHooks.sol/IRelic.json +35 -0
  161. package/artifacts/contracts/web3call/combined-hooks/LiftHooks.sol/LiftHooks.json +256 -0
  162. package/artifacts/contracts/web3call/configure-hooks/{abstractPMPConfigureHook.sol → AbstractPMPConfigureHook.sol}/AbstractPMPConfigureHook.json +1 -1
  163. package/artifacts/contracts/web3call/configure-hooks/PMPConfigureLockHook.sol/PMPConfigureLockHook.json +195 -0
  164. package/contracts/AdminACLV0RoyaltyRegistry.sol +142 -0
  165. package/contracts/DependencyRegistryV0.sol +143 -13
  166. package/contracts/GenArt721CoreV3_Curated.sol +1 -1
  167. package/contracts/GenArt721CoreV3_Curated_Flex.sol +173 -0
  168. package/contracts/GenArt721CoreV3_Explorations_Flex.sol +159 -0
  169. package/contracts/engine/V3/EngineFactoryV0.sol +20 -1
  170. package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +286 -299
  171. package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +292 -301
  172. package/contracts/engine/V3/transfer-hooks/AbstractTransferHook.sol +101 -0
  173. package/contracts/engine/V3/transfer-hooks/OwnerHistoryTransferHook.sol +291 -0
  174. package/contracts/generator/GenArt721GeneratorV0.sol +145 -47
  175. package/contracts/helpers/ERC1967ProxyImport.sol +5 -0
  176. package/contracts/interfaces/v0.8.x/IArtblocksRoyaltyOverride.sol +1 -1
  177. package/contracts/interfaces/v0.8.x/IClaimMinter.sol +70 -0
  178. package/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol +95 -0
  179. package/contracts/interfaces/v0.8.x/IEngineFactoryV0.sol +15 -0
  180. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol +21 -2
  181. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol +72 -0
  182. package/contracts/interfaces/v0.8.x/IOwnerHistoryTransferHook.sol +119 -0
  183. package/contracts/interfaces/v0.8.x/IPMPV0.sol +5 -3
  184. package/contracts/interfaces/v0.8.x/ISRHooks.sol +229 -0
  185. package/contracts/interfaces/v0.8.x/ISeaDropShimForContract.sol +0 -6
  186. package/contracts/interfaces/v0.8.x/ISharedMinterTieredAllowV0.sol +69 -0
  187. package/contracts/interfaces/v0.8.x/ITransferHook.sol +48 -0
  188. package/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol +12 -0
  189. package/contracts/libs/v0.8.x/ENSLib.sol +85 -0
  190. package/contracts/libs/v0.8.x/EnumerableSetUint16.sol +429 -0
  191. package/contracts/libs/v0.8.x/FeistelWalkLib.sol +221 -0
  192. package/contracts/libs/v0.8.x/ImmutableUint16Array.sol +201 -0
  193. package/contracts/libs/v0.8.x/V3EngineLib.sol +490 -0
  194. package/contracts/libs/v0.8.x/V3TransferHookLib.sol +251 -0
  195. package/contracts/libs/v0.8.x/minter-libs/OnChainAllowlistLib.sol +165 -0
  196. package/contracts/minter-suite/Minters/MinterSetPriceOnChainAllowV0.sol +632 -0
  197. package/contracts/minter-suite/Minters/MinterSetPriceTieredAllowV1.sol +871 -0
  198. package/contracts/minter-suite/Minters/MinterSlidingScaleV0.sol +493 -0
  199. package/contracts/minter-suite/Minters/one-off/ClaimMinter.sol +595 -0
  200. package/contracts/minter-suite/Minters/one-off/MinterSetPriceTieredOnChainAllowV0.sol +894 -0
  201. package/contracts/minter-suite/Minters/one-off/SeaDropXArtBlocksShim.sol +59 -41
  202. package/contracts/mock/ENSLibMock.sol +25 -0
  203. package/contracts/mock/EnumerableSetUint16Mock.sol +88 -0
  204. package/contracts/mock/FeistelWalkLibMock.sol +81 -0
  205. package/contracts/mock/ImmutableUint16ArrayMock.sol +62 -0
  206. package/contracts/mock/MockGenArt721V3Core.sol +416 -0
  207. package/contracts/mock/MockPMP.sol +287 -0
  208. package/contracts/mock/MockTransferHook.sol +160 -0
  209. package/contracts/mock/MockTransferHookTestHelpers.sol +96 -0
  210. package/contracts/mock/ReentrancyBatchMockShared.sol +53 -0
  211. package/contracts/mock/RelayExecutorTestHelper.sol +44 -0
  212. package/contracts/relay/RelayExecutor.sol +61 -0
  213. package/contracts/relay/RelayExecutorPartialReverts.sol +79 -0
  214. package/contracts/royalty-registry/GenArt721RoyaltyOverrideSplits.sol +130 -0
  215. package/contracts/utils/MintMulticallUtil.sol +103 -0
  216. package/contracts/web3call/PMPV0.sol +92 -98
  217. package/contracts/web3call/PMPV1.sol +1204 -0
  218. package/contracts/web3call/augment-hooks/AbstractPMPAugmentHook.sol +1 -1
  219. package/contracts/web3call/augment-hooks/InjectBaseGasFee.sol +1 -1
  220. package/contracts/web3call/augment-hooks/InjectBlockHeight.sol +57 -0
  221. package/contracts/web3call/augment-hooks/InjectBlockHeightAndArtistProjectOverrides.sol +310 -0
  222. package/contracts/web3call/augment-hooks/InjectBlockHeightAndNumOwnedProjectTokens.sol +141 -0
  223. package/contracts/web3call/augment-hooks/InjectBlockHeightProjectInvocationsAndArtistProjectOverrides.sol +326 -0
  224. package/contracts/web3call/augment-hooks/InjectBlockTimestamp.sol +57 -0
  225. package/contracts/web3call/augment-hooks/InjectBytesPerToken.sol +279 -0
  226. package/contracts/web3call/augment-hooks/InjectIsProjectFullyMinted.sol +1 -1
  227. package/contracts/web3call/augment-hooks/InjectTokenHashSeed.sol +1 -1
  228. package/contracts/web3call/augment-hooks/InjectTokenOwner.sol +1 -1
  229. package/contracts/web3call/augment-hooks/InjectTokenOwnerEthBalance.sol +1 -1
  230. package/contracts/web3call/augment-hooks/SRHooks.sol +1722 -0
  231. package/contracts/web3call/combined-hooks/LiftHooks.sol +304 -0
  232. package/contracts/web3call/configure-hooks/{abstractPMPConfigureHook.sol → AbstractPMPConfigureHook.sol} +1 -1
  233. package/contracts/web3call/configure-hooks/PMPConfigureLockHook.sol +107 -0
  234. package/package.json +40 -25
@@ -0,0 +1,229 @@
1
+ // SPDX-License-Identifier: LGPL-3.0-only
2
+ // Creatd By: Art Blocks Inc.
3
+
4
+ pragma solidity ^0.8.0;
5
+
6
+ /**
7
+ * @title ISRHooks
8
+ * @author Art Blocks Inc.
9
+ * @notice This interface defines the custom events and functions for the SRHooks contract.
10
+ * It does not include any of the IPMPV0 events, which are indexed separately.
11
+ */
12
+ interface ISRHooks {
13
+ /**
14
+ * @notice Emitted when the contract is initialized
15
+ * @param coreContractAddress The address of the core contract.
16
+ * @param coreProjectId The project ID of the core contract.
17
+ */
18
+ event SRHooksInitialized(
19
+ address coreContractAddress,
20
+ uint256 coreProjectId
21
+ );
22
+
23
+ /**
24
+ * @notice Emitted when the tokens sending to a token are updated
25
+ * @param coreContract The address of the core contract.
26
+ * @param tokenId The ID of the token.
27
+ * @param tokensSendingTo The tokens sending to the token.
28
+ */
29
+ event TokenSendingToUpdated(
30
+ address indexed coreContract,
31
+ uint256 indexed tokenId,
32
+ uint16[] tokensSendingTo
33
+ );
34
+
35
+ /**
36
+ * @notice Emitted when the tokens sending to a token are updated
37
+ * @param coreContract The address of the core contract.
38
+ * @param tokenId The ID of the token.
39
+ * @param tokensReceivingFrom The tokens receiving from the token.
40
+ */
41
+ event TokenReceivingFromUpdated(
42
+ address indexed coreContract,
43
+ uint256 indexed tokenId,
44
+ uint16[] tokensReceivingFrom
45
+ );
46
+
47
+ /**
48
+ * @notice Struct for the token metadata calldata.
49
+ * @param updateImage Whether to update the image data.
50
+ * @param imageDataCompressed The compressed image data.
51
+ * @param updateSound Whether to update the sound data.
52
+ * @param soundDataCompressed The compressed sound data.
53
+ */
54
+ struct TokenMetadataCalldata {
55
+ bool updateImage; // true if updating the image data
56
+ bytes imageDataCompressed; // non-empty if updating the image data
57
+ bool updateSound; // true if updating the sound data
58
+ bytes soundDataCompressed; // may be empty to clear the sound data, non-empty if setting the sound data
59
+ }
60
+
61
+ /**
62
+ * @notice Struct for the token metadata view.
63
+ * @param imageDataCompressed The compressed image data.
64
+ * @param imageVersion The version of the image data.
65
+ * @param soundDataCompressed The compressed sound data.
66
+ * @param soundVersion The version of the sound data.
67
+ */
68
+ struct TokenMetadataView {
69
+ bytes imageDataCompressed;
70
+ uint16 imageVersion;
71
+ bytes soundDataCompressed;
72
+ uint16 soundVersion;
73
+ }
74
+
75
+ struct TokenLiveData {
76
+ uint256 tokenNumber;
77
+ address ownerAddress;
78
+ bytes imageDataCompressed;
79
+ bytes soundDataCompressed;
80
+ string ownerEnsName;
81
+ }
82
+
83
+ // enum for the different possible states of a token's SR configuration
84
+ enum SendStates {
85
+ Neutral,
86
+ SendGeneral,
87
+ SendTo
88
+ }
89
+
90
+ enum ReceiveStates {
91
+ Neutral,
92
+ ReceiveGeneral,
93
+ ReceiveFrom,
94
+ ReceiveTo
95
+ }
96
+
97
+ /**
98
+ * @notice Updates the state and metadata for a given token.
99
+ * Reverts if the token number is invalid or the msg.sender is not owner or valid delegate.xyz V2 of token owner.
100
+ * Reverts if invalid configuration is provided.
101
+ * Includes two boolean flags to update the send and receive states and token metadata separately, in a single function call.
102
+ * Never allows updating to a slot that is invalid.
103
+ * @param tokenNumber The token number to update.
104
+ * @param updateSendState Whether to update the send state.
105
+ * @param sendState The new send state. Valid values are SendGeneral, SendTo, Neutral.
106
+ * @param tokensSendingTo Tokens to send this token to. Only non-empty iff updateSendState is true and sendState is SendTo.
107
+ * Duplicates are automatically deduplicated when calculating dilution rates.
108
+ * @param updateReceiveState Whether to update the receive state.
109
+ * @param receiveState The new receive state. Valid values are ReceiveGeneral, ReceiveFrom, Neutral.
110
+ * @param tokensReceivingFrom Tokens this token is open to receive from. Only non-empty iff updateReceiveState is true and receiveState is ReceiveFrom.
111
+ * Duplicates and self-referential entries are automatically filtered in getLiveData results.
112
+ * @param updateTokenMetadata Whether to update the token metadata.
113
+ * @param updatedActiveSlot The new active slot. If updating token metadata, this is the new active slot.
114
+ * @param tokenMetadataCalldata The new token metadata. If updating token metadata, this is the new token metadata at the updated active slot. Only non-empty iff updateTokenMetadata is true.
115
+ */
116
+ function updateTokenStateAndMetadata(
117
+ uint256 tokenNumber,
118
+ bool updateSendState,
119
+ SendStates sendState,
120
+ uint16[] memory tokensSendingTo,
121
+ bool updateReceiveState,
122
+ ReceiveStates receiveState,
123
+ uint16[] memory tokensReceivingFrom,
124
+ bool updateTokenMetadata,
125
+ uint256 updatedActiveSlot,
126
+ TokenMetadataCalldata memory tokenMetadataCalldata
127
+ ) external;
128
+
129
+ /**
130
+ * @notice Gets the live data for a given token.
131
+ * @param tokenNumber The token number to get the live data for.
132
+ * @param blockNumber The block number to get the live data for. Must be in latest 256 blocks.
133
+ * @param maxReceive The maximum number of tokens to receive, in each array of receivedTokensGeneral and receivedTokensTo.
134
+ * maxReceive must be less than or equal to MAX_RECEIVE_RATE_PER_BLOCK.
135
+ * Treats block number of 0 as latest completed block.
136
+ * Reverts if block number is in future - need block hash to be defined.
137
+ * NOTE: Each array of receivedTokensGeneral and receivedTokensTo has a maximum length of maxReceive,
138
+ * but their combined length may be greater than maxReceive. The art script should handle this by
139
+ * deterministically shuffling/sampling from the arrays if desired.
140
+ * WARNING: This function is designed for off-chain view calls only and may exceed block gas limits in cases where
141
+ * a token has many senders or is receiving from many tokens. It is not intended to be called within transactions.
142
+ * WARNING: Self-referential SendGeneral and SendTo tokens may be included in the results.
143
+ * @return sendState The send state of the token.
144
+ * @return receiveState The receive state of the token.
145
+ * @return receivedTokensGeneral The received tokens general of the token.
146
+ * @return receivedTokensTo The received tokens to of the token.
147
+ * @return numSendGeneral The number of tokens in the send general pool.
148
+ * @return numReceiveGeneral The number of tokens in the receive general pool.
149
+ * @return numSendingToMe The number of tokens sending to me.
150
+ * @return usedBlockNumber The block number used to generate the random numbers.
151
+ */
152
+ function getLiveData(
153
+ uint256 tokenNumber,
154
+ uint256 blockNumber,
155
+ uint256 maxReceive
156
+ )
157
+ external
158
+ view
159
+ returns (
160
+ SendStates sendState,
161
+ ReceiveStates receiveState,
162
+ TokenLiveData[] memory receivedTokensGeneral,
163
+ TokenLiveData[] memory receivedTokensTo,
164
+ uint256 numSendGeneral,
165
+ uint256 numReceiveGeneral,
166
+ uint256 numSendingToMe,
167
+ uint256 usedBlockNumber
168
+ );
169
+
170
+ /**
171
+ * @notice Gets the state of the general pools.
172
+ * @return sendGeneralTokensLength The length of the send general tokens.
173
+ * @return receiveGeneralTokensLength The length of the receive general tokens.
174
+ */
175
+ function getGeneralPoolState()
176
+ external
177
+ view
178
+ returns (
179
+ uint256 sendGeneralTokensLength,
180
+ uint256 receiveGeneralTokensLength
181
+ );
182
+
183
+ /**
184
+ * @notice Gets the state of a given token.
185
+ * @param tokenNumber The token number to get the state for.
186
+ * @return sendState The send state.
187
+ * @return receiveState The receive state.
188
+ * @return tokensSendingTo The tokens sending to the token.
189
+ * @return tokensReceivingFrom The tokens receiving from the token.
190
+ * @return activeSlot The active slot.
191
+ * @return activeSlotTokenMetadata The token metadata at the active slot.
192
+ * @return ownerAddress The address of the token owner.
193
+ */
194
+ function getTokenState(
195
+ uint256 tokenNumber
196
+ )
197
+ external
198
+ view
199
+ returns (
200
+ SendStates sendState,
201
+ ReceiveStates receiveState,
202
+ uint16[] memory tokensSendingTo,
203
+ uint16[] memory tokensReceivingFrom,
204
+ uint256 activeSlot,
205
+ TokenMetadataView memory activeSlotTokenMetadata,
206
+ address ownerAddress
207
+ );
208
+
209
+ /**
210
+ * @notice Gets the token metadata at a given slot.
211
+ * @param tokenNumber The token number to get the token metadata for.
212
+ * @param slot The slot to get the token metadata for.
213
+ * @return tokenMetadata The token metadata at the given slot.
214
+ */
215
+ function getTokenMetadataAtSlot(
216
+ uint256 tokenNumber,
217
+ uint256 slot
218
+ ) external view returns (TokenMetadataView memory tokenMetadata);
219
+
220
+ /**
221
+ * @notice Gets the tokens sending to a given token.
222
+ * WARNING: This function is unbounded in gas cost, and is designed to be used by view accessors only. Use with caution.
223
+ * @param tokenNumber The token number to get the tokens sending to for.
224
+ * @return tokensSendingTo The token numbers sending to the given token.
225
+ */
226
+ function getTokensSendingToToken(
227
+ uint256 tokenNumber
228
+ ) external view returns (uint256[] memory tokensSendingTo);
229
+ }
@@ -10,10 +10,4 @@ interface ISeaDropShimForContract {
10
10
  * @param nftContract The address of the NFT contract that this shim contract is compatible with
11
11
  */
12
12
  event SeaDropShimForContract(address nftContract);
13
-
14
- /**
15
- * @dev Emit event when the local max supply is updated
16
- * @param newLocalMaxSupply The new local max supply
17
- */
18
- event LocalMaxSupplyUpdated(uint256 newLocalMaxSupply);
19
13
  }
@@ -0,0 +1,69 @@
1
+ // SPDX-License-Identifier: LGPL-3.0-only
2
+ // Created By: Art Blocks Inc.
3
+
4
+ pragma solidity ^0.8.0;
5
+
6
+ /**
7
+ * @title This interface adds support for tiered allowlist pricing.
8
+ * @notice Intended for shared minters that expose both a public price and a
9
+ * privileged allowlist price, and that can resolve the effective price for a
10
+ * given wallet.
11
+ * @author Art Blocks Inc.
12
+ */
13
+ interface ISharedMinterTieredAllowV0 {
14
+ /**
15
+ * @notice Gets if price is configured, allowlist price of minting a token
16
+ * on project `projectId`, and currency symbol and address to be used as
17
+ * payment.
18
+ * @param projectId Project ID to get allowlist price information for
19
+ * @param coreContract Contract address of the core contract
20
+ * @return isConfigured true only if prices have been configured on this
21
+ * minter
22
+ * @return tokenPriceInWei current allowlist price of token on this minter
23
+ * @return currencySymbol currency symbol for purchases of project on this
24
+ * minter
25
+ * @return currencyAddress currency address for purchases of project on
26
+ * this minter
27
+ */
28
+ function getAllowlistPriceInfo(
29
+ uint256 projectId,
30
+ address coreContract
31
+ )
32
+ external
33
+ view
34
+ returns (
35
+ bool isConfigured,
36
+ uint256 tokenPriceInWei,
37
+ string memory currencySymbol,
38
+ address currencyAddress
39
+ );
40
+
41
+ /**
42
+ * @notice Returns the effective price for a given wallet address on
43
+ * project `projectId`. If the wallet is allowlisted, returns the
44
+ * allowlist price; otherwise returns the public price.
45
+ * @param projectId Project ID to get price information for
46
+ * @param coreContract Contract address of the core contract
47
+ * @param wallet Address to check the effective price for
48
+ * @return isConfigured true only if prices have been configured for the
49
+ * project
50
+ * @return tokenPriceInWei effective price per token for the given wallet
51
+ * @return currencySymbol currency symbol for purchases of project on this
52
+ * minter
53
+ * @return currencyAddress currency address for purchases of project on
54
+ * this minter
55
+ */
56
+ function getPriceInfoForAddress(
57
+ uint256 projectId,
58
+ address coreContract,
59
+ address wallet
60
+ )
61
+ external
62
+ view
63
+ returns (
64
+ bool isConfigured,
65
+ uint256 tokenPriceInWei,
66
+ string memory currencySymbol,
67
+ address currencyAddress
68
+ );
69
+ }
@@ -0,0 +1,48 @@
1
+ // SPDX-License-Identifier: LGPL-3.0-only
2
+ // Created By: Art Blocks Inc.
3
+
4
+ pragma solidity ^0.8.0;
5
+
6
+ import {IERC165} from "@openzeppelin-5.0/contracts/interfaces/IERC165.sol";
7
+
8
+ /**
9
+ * @title Transfer hook interface for Art Blocks V3 Engine cores.
10
+ * @author Art Blocks Inc.
11
+ * @notice Invoked by a core after a token's ownership has been updated (mint
12
+ * or transfer). A reverting hook aborts the entire mint or transfer.
13
+ * Implementations MUST authenticate `msg.sender` as the expected core; the
14
+ * core passes `coreContract` for convenience when one hook serves many cores.
15
+ * Inheriting `AbstractTransferHook` is the recommended way to satisfy both
16
+ * that requirement and the ERC-165 requirement below.
17
+ * @dev A core will not accept a hook unless it ERC-165-advertises this
18
+ * interface. The ERC-165 interface ID is `0x6344b0e2`, which is
19
+ * `type(ITransferHook).interfaceId` — the selector of `onTokenTransfer`
20
+ * alone. Solidity excludes inherited interface functions (here, `IERC165`)
21
+ * from that XOR, so implementers hardcoding the value must use `0x6344b0e2`
22
+ * and not XOR in `IERC165`'s `0x01ffc9a7`.
23
+ */
24
+ interface ITransferHook is IERC165 {
25
+ /**
26
+ * @notice Execution logic to be executed after a token's ownership updates.
27
+ * @dev Called after the ERC-721 ownership write. On mint, called after the
28
+ * token hash seed is assigned. Reverting aborts the mint or transfer.
29
+ * @dev The calling core blocks reentrant mints and transfers for the
30
+ * duration of this call, on every project of that core. Implementations
31
+ * must not attempt to mint or transfer on the calling core.
32
+ * @param coreContract The core contract that performed the ownership update.
33
+ * Also equal to `msg.sender` when called by a conforming core.
34
+ * @param tokenId The token whose ownership changed.
35
+ * @param from Previous owner. `address(0)` on mint.
36
+ * @param to New owner. `address(0)` on burn (cores do not currently burn).
37
+ * @param operator For transfers, the ERC-721 operator (`_msgSender()`).
38
+ * For mint, the `_by` address passed to `mint_Ecf` (the initiating user,
39
+ * not the minter contract).
40
+ */
41
+ function onTokenTransfer(
42
+ address coreContract,
43
+ uint256 tokenId,
44
+ address from,
45
+ address to,
46
+ address operator
47
+ ) external;
48
+ }
@@ -4,6 +4,7 @@ pragma solidity ^0.8.19;
4
4
  import "../../interfaces/v0.8.x/IAdminACLV0.sol";
5
5
  import "../../interfaces/v0.8.x/ICoreRegistryV1.sol";
6
6
  import "../../interfaces/v0.8.x/IUniversalBytecodeStorageReader.sol";
7
+ import {IDependencyRegistryV0} from "../../interfaces/v0.8.x/IDependencyRegistryV0.sol";
7
8
  import "@openzeppelin-4.7/contracts/utils/structs/EnumerableSet.sol";
8
9
 
9
10
  /**
@@ -51,6 +52,17 @@ library DependencyRegistryStorageLib {
51
52
  uint24 additionalRepositoryCount;
52
53
  // count of scripts that make up the dependency, if the dependency is available on-chain
53
54
  uint24 scriptCount;
55
+ // @dev fields below are appended for the generator's rendering directives, and are
56
+ // safe to append because Dependency is only ever used as a mapping value.
57
+ // canvas tag requirement for the dependency
58
+ IDependencyRegistryV0.CanvasTagType canvasTagType;
59
+ // how a project's script must be injected into generated HTML
60
+ IDependencyRegistryV0.ProjectScriptTagType projectScriptTagType;
61
+ // whether the dependency's own script is an ES module, and therefore must be exposed to
62
+ // project scripts via an import map rather than loaded with a plain `<script src>` tag
63
+ bool loadAsModule;
64
+ // `type` attribute used when projectScriptTagType is SpecialType; empty otherwise
65
+ string projectScriptSpecialType;
54
66
  }
55
67
 
56
68
  /**
@@ -0,0 +1,85 @@
1
+ // SPDX-License-Identifier: LGPL-3.0-only
2
+ // Created By: Art Blocks Inc.
3
+
4
+ pragma solidity ^0.8.0;
5
+
6
+ /**
7
+ * @title IUniversalResolver
8
+ * @notice Minimal ENS Universal Resolver interface for reverse resolution
9
+ * @dev See https://docs.ens.domains/resolvers/universal#reverse-resolution
10
+ */
11
+ interface IUniversalResolver {
12
+ function reverse(
13
+ bytes calldata lookupAddress,
14
+ uint256 coinType
15
+ )
16
+ external
17
+ view
18
+ returns (
19
+ string memory primary,
20
+ address resolver,
21
+ address reverseResolver
22
+ );
23
+ }
24
+
25
+ /**
26
+ * @title ENS Library
27
+ * @notice This library provides helper functions for ENS name resolution
28
+ * using the ENS Universal Resolver following ENS best practices.
29
+ * @author Art Blocks Inc.
30
+ * @dev This library uses the Universal Resolver's reverse() function which
31
+ * performs both reverse lookup AND forward verification in a single call.
32
+ * For an address to have a valid ENS name returned by this library, the owner
33
+ * must set up a reverse record (reverse lookup) by calling setName() on the
34
+ * reverse registrar. This is OPTIONAL and must be done by the address owner
35
+ * on-chain. If not set, the library returns an empty string.
36
+ *
37
+ * References:
38
+ * - Universal Resolver: https://docs.ens.domains/resolvers/universal
39
+ * - Reverse Resolution: https://docs.ens.domains/resolvers/universal#reverse-resolution
40
+ */
41
+ library ENSLib {
42
+ /// @notice ENS Universal Resolver deployment address (same on mainnet and testnets)
43
+ /// @dev This is a proxy contract owned by ENS DAO
44
+ /// See: https://docs.ens.domains/resolvers/universal
45
+ address internal constant UNIVERSAL_RESOLVER_ADDRESS =
46
+ 0xeEeEEEeE14D718C2B47D9923Deab1335E144EeEe;
47
+
48
+ /// @notice Coin type for Ethereum (used in reverse resolution)
49
+ /// @dev See ENSIP-9 for multichain address resolution
50
+ uint256 internal constant COIN_TYPE_ETH = 60;
51
+
52
+ /**
53
+ * @notice Resolves an ENS name for a given address using the Universal Resolver.
54
+ * @dev Uses the ENS Universal Resolver's reverse() function which internally:
55
+ * 1. Performs reverse lookup to get the name claimed by the address
56
+ * 2. Verifies forward resolution to ensure the name actually resolves back to the address
57
+ *
58
+ * This provides protection against spoofing in a single call.
59
+ *
60
+ * NOTE: For an address to have a valid ENS name returned by this function, the owner must:
61
+ * - Set up a reverse record (reverse lookup) by calling setName() on the reverse registrar
62
+ * - This is OPTIONAL and must be done by the address owner on-chain
63
+ * - If not set, this function returns an empty string
64
+ *
65
+ * @param ownerAddress The address to resolve the ENS name for.
66
+ * @return ensName The ENS name for the address, or empty string if not found/invalid.
67
+ */
68
+ function getEnsName(
69
+ address ownerAddress
70
+ ) internal view returns (string memory) {
71
+ // Call the Universal Resolver's reverse function
72
+ // The reverse function internally performs both reverse lookup and forward verification
73
+ try
74
+ IUniversalResolver(UNIVERSAL_RESOLVER_ADDRESS).reverse(
75
+ abi.encodePacked(ownerAddress),
76
+ COIN_TYPE_ETH
77
+ )
78
+ returns (string memory primary, address, address) {
79
+ return primary;
80
+ } catch {
81
+ // If any error occurs (no reverse record, forward mismatch, etc.), return empty string
82
+ return "";
83
+ }
84
+ }
85
+ }