diff --git a/src/core/token/ERC1155Core.sol b/src/core/token/ERC1155Core.sol index add51c23..09546aaa 100644 --- a/src/core/token/ERC1155Core.sol +++ b/src/core/token/ERC1155Core.sol @@ -2,6 +2,7 @@ pragma solidity ^0.8.0; import { Initializable } from "@solady/utils/Initializable.sol"; +import { Multicallable } from "@solady/utils/Multicallable.sol"; import { IERC7572 } from "../../interface/eip/IERC7572.sol"; import { IERC1155CoreCustomErrors } from "../../interface/errors/IERC1155CoreCustomErrors.sol"; @@ -16,6 +17,7 @@ import { ERC1155CoreStorage } from "../../storage/core/ERC1155CoreStorage.sol"; contract ERC1155Core is Initializable, + Multicallable, ERC1155Initializable, HookInstaller, Permission, diff --git a/src/core/token/ERC20Core.sol b/src/core/token/ERC20Core.sol index 93811c3b..e7d185c6 100644 --- a/src/core/token/ERC20Core.sol +++ b/src/core/token/ERC20Core.sol @@ -2,6 +2,7 @@ pragma solidity ^0.8.0; import { Initializable } from "@solady/utils/Initializable.sol"; +import { Multicallable } from "@solady/utils/Multicallable.sol"; import { IERC7572 } from "../../interface/eip/IERC7572.sol"; import { IERC20CoreCustomErrors } from "../../interface/errors/IERC20CoreCustomErrors.sol"; @@ -16,6 +17,7 @@ import { ERC20CoreStorage } from "../../storage/core/ERC20CoreStorage.sol"; contract ERC20Core is Initializable, + Multicallable, ERC20Initializable, HookInstaller, Permission, diff --git a/src/core/token/ERC721Core.sol b/src/core/token/ERC721Core.sol index 2a87feb5..b2c6721c 100644 --- a/src/core/token/ERC721Core.sol +++ b/src/core/token/ERC721Core.sol @@ -2,6 +2,7 @@ pragma solidity ^0.8.0; import { Initializable } from "@solady/utils/Initializable.sol"; +import { Multicallable } from "@solady/utils/Multicallable.sol"; import { IERC7572 } from "../../interface/eip/IERC7572.sol"; import { IERC721CoreCustomErrors } from "../../interface/errors/IERC721CoreCustomErrors.sol"; @@ -16,6 +17,7 @@ import { ERC721CoreStorage } from "../../storage/core/ERC721CoreStorage.sol"; contract ERC721Core is Initializable, + Multicallable, ERC721Initializable, HookInstaller, Permission, diff --git a/src/hook/metadata/LazyMintHook.sol b/src/hook/metadata/LazyMintHook.sol index 97a265ac..62a1558a 100644 --- a/src/hook/metadata/LazyMintHook.sol +++ b/src/hook/metadata/LazyMintHook.sol @@ -2,13 +2,14 @@ pragma solidity ^0.8.0; import { LibString } from "@solady/utils/LibString.sol"; +import { Multicallable } from "@solady/utils/Multicallable.sol"; import { ERC721Hook } from "../ERC721Hook.sol"; import { IPermission } from "../../interface/common/IPermission.sol"; import { LazyMintStorage } from "../../storage/hook/metadata/LazyMintStorage.sol"; -contract LazyMintHook is ERC721Hook { +contract LazyMintHook is ERC721Hook, Multicallable { using LibString for uint256; /*////////////////////////////////////////////////////////////// diff --git a/src/hook/metadata/OpenEditionHookERC721.sol b/src/hook/metadata/OpenEditionHookERC721.sol index 0969fddd..566ff35f 100644 --- a/src/hook/metadata/OpenEditionHookERC721.sol +++ b/src/hook/metadata/OpenEditionHookERC721.sol @@ -1,6 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; +import { Multicallable } from "@solady/utils/Multicallable.sol"; + import { IPermission } from "../../interface/common/IPermission.sol"; import { ERC721Hook } from "../ERC721Hook.sol"; @@ -9,7 +11,7 @@ import { NFTMetadataRenderer } from "../../lib/NFTMetadataRenderer.sol"; import { SharedMetadataStorage } from "../../storage/hook/metadata/SharedMetadataStorage.sol"; import { ISharedMetadata } from "../../interface/common/ISharedMetadata.sol"; -contract OpenEditionHookERC721 is ISharedMetadata, ERC721Hook { +contract OpenEditionHookERC721 is ISharedMetadata, ERC721Hook, Multicallable { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ diff --git a/src/hook/metadata/SimpleMetadataHook.sol b/src/hook/metadata/SimpleMetadataHook.sol index c2e8104b..361a6573 100644 --- a/src/hook/metadata/SimpleMetadataHook.sol +++ b/src/hook/metadata/SimpleMetadataHook.sol @@ -2,13 +2,14 @@ pragma solidity ^0.8.0; import { LibString } from "@solady/utils/LibString.sol"; +import { Multicallable } from "@solady/utils/Multicallable.sol"; import { ERC721Hook } from "../ERC721Hook.sol"; import { IPermission } from "../../interface/common/IPermission.sol"; import { SimpleMetadataStorage } from "../../storage/hook/metadata/SimpleMetadataStorage.sol"; -contract SimpleMetadataHook is ERC721Hook { +contract SimpleMetadataHook is ERC721Hook, Multicallable { using LibString for uint256; /*////////////////////////////////////////////////////////////// diff --git a/src/hook/mint/AllowlistMintHookERC1155.sol b/src/hook/mint/AllowlistMintHookERC1155.sol index 427d118c..84b9d685 100644 --- a/src/hook/mint/AllowlistMintHookERC1155.sol +++ b/src/hook/mint/AllowlistMintHookERC1155.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.0; import { MerkleProofLib } from "@solady/utils/MerkleProofLib.sol"; import { SafeTransferLib } from "@solady/utils/SafeTransferLib.sol"; +import { Multicallable } from "@solady/utils/Multicallable.sol"; import { IFeeConfig } from "../../interface/common/IFeeConfig.sol"; import { IPermission } from "../../interface/common/IPermission.sol"; @@ -10,7 +11,7 @@ import { ERC1155Hook } from "../ERC1155Hook.sol"; import { AllowlistMintHookERC1155Storage } from "../../storage/hook/mint/AllowlistMintHookERC1155Storage.sol"; -contract AllowlistMintHookERC1155 is IFeeConfig, ERC1155Hook { +contract AllowlistMintHookERC1155 is IFeeConfig, ERC1155Hook, Multicallable { /*////////////////////////////////////////////////////////////// STRUCTS //////////////////////////////////////////////////////////////*/ diff --git a/src/hook/mint/AllowlistMintHookERC20.sol b/src/hook/mint/AllowlistMintHookERC20.sol index 3b2978f8..3d7981f9 100644 --- a/src/hook/mint/AllowlistMintHookERC20.sol +++ b/src/hook/mint/AllowlistMintHookERC20.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.0; import { MerkleProofLib } from "@solady/utils/MerkleProofLib.sol"; import { SafeTransferLib } from "@solady/utils/SafeTransferLib.sol"; +import { Multicallable } from "@solady/utils/Multicallable.sol"; import { IFeeConfig } from "../../interface/common/IFeeConfig.sol"; import { IPermission } from "../../interface/common/IPermission.sol"; @@ -10,7 +11,7 @@ import { ERC20Hook } from "../ERC20Hook.sol"; import { AllowlistMintHookERC20Storage } from "../../storage/hook/mint/AllowlistMintHookERC20Storage.sol"; -contract AllowlistMintHookERC20 is IFeeConfig, ERC20Hook { +contract AllowlistMintHookERC20 is IFeeConfig, ERC20Hook, Multicallable { /*////////////////////////////////////////////////////////////// STRUCTS //////////////////////////////////////////////////////////////*/ diff --git a/src/hook/mint/AllowlistMintHookERC721.sol b/src/hook/mint/AllowlistMintHookERC721.sol index b6dfdcc1..9c59e3c9 100644 --- a/src/hook/mint/AllowlistMintHookERC721.sol +++ b/src/hook/mint/AllowlistMintHookERC721.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.0; import { MerkleProofLib } from "@solady/utils/MerkleProofLib.sol"; import { SafeTransferLib } from "@solady/utils/SafeTransferLib.sol"; +import { Multicallable } from "@solady/utils/Multicallable.sol"; import { IFeeConfig } from "../../interface/common/IFeeConfig.sol"; import { IPermission } from "../../interface/common/IPermission.sol"; @@ -10,7 +11,7 @@ import { ERC721Hook } from "../ERC721Hook.sol"; import { AllowlistMintHookERC721Storage } from "../../storage/hook/mint/AllowlistMintHookERC721Storage.sol"; -contract AllowlistMintHookERC721 is IFeeConfig, ERC721Hook { +contract AllowlistMintHookERC721 is IFeeConfig, ERC721Hook, Multicallable { /*////////////////////////////////////////////////////////////// STRUCTS //////////////////////////////////////////////////////////////*/ diff --git a/src/hook/mint/MintHookERC1155.sol b/src/hook/mint/MintHookERC1155.sol index d80ff237..d5fc89b3 100644 --- a/src/hook/mint/MintHookERC1155.sol +++ b/src/hook/mint/MintHookERC1155.sol @@ -5,6 +5,7 @@ import { EIP712 } from "@solady/utils/EIP712.sol"; import { ECDSA } from "@solady/utils/ECDSA.sol"; import { MerkleProofLib } from "@solady/utils/MerkleProofLib.sol"; import { SafeTransferLib } from "@solady/utils/SafeTransferLib.sol"; +import { Multicallable } from "@solady/utils/Multicallable.sol"; import { IFeeConfig } from "../../interface/common/IFeeConfig.sol"; import { IPermission } from "../../interface/common/IPermission.sol"; @@ -15,7 +16,7 @@ import { ERC1155Hook } from "../ERC1155Hook.sol"; import { MintHookERC1155Storage } from "../../storage/hook/mint/MintHookERC1155Storage.sol"; -contract MintHookERC1155 is IFeeConfig, IMintRequest, IClaimCondition, EIP712, ERC1155Hook { +contract MintHookERC1155 is IFeeConfig, IMintRequest, IClaimCondition, EIP712, ERC1155Hook, Multicallable { using ECDSA for bytes32; /*////////////////////////////////////////////////////////////// diff --git a/src/hook/mint/MintHookERC20.sol b/src/hook/mint/MintHookERC20.sol index 5b259867..a3859837 100644 --- a/src/hook/mint/MintHookERC20.sol +++ b/src/hook/mint/MintHookERC20.sol @@ -5,6 +5,7 @@ import { EIP712 } from "@solady/utils/EIP712.sol"; import { ECDSA } from "@solady/utils/ECDSA.sol"; import { MerkleProofLib } from "@solady/utils/MerkleProofLib.sol"; import { SafeTransferLib } from "@solady/utils/SafeTransferLib.sol"; +import { Multicallable } from "@solady/utils/Multicallable.sol"; import { IFeeConfig } from "../../interface/common/IFeeConfig.sol"; import { IPermission } from "../../interface/common/IPermission.sol"; @@ -15,7 +16,7 @@ import { ERC20Hook } from "../ERC20Hook.sol"; import { MintHookERC20Storage } from "../../storage/hook/mint/MintHookERC20Storage.sol"; -contract MintHookERC20 is IFeeConfig, IMintRequest, IClaimCondition, EIP712, ERC20Hook { +contract MintHookERC20 is IFeeConfig, IMintRequest, IClaimCondition, EIP712, ERC20Hook, Multicallable { using ECDSA for bytes32; /*////////////////////////////////////////////////////////////// diff --git a/src/hook/mint/MintHookERC721.sol b/src/hook/mint/MintHookERC721.sol index 28f652f4..3931ef7a 100644 --- a/src/hook/mint/MintHookERC721.sol +++ b/src/hook/mint/MintHookERC721.sol @@ -5,6 +5,7 @@ import { EIP712 } from "@solady/utils/EIP712.sol"; import { ECDSA } from "@solady/utils/ECDSA.sol"; import { MerkleProofLib } from "@solady/utils/MerkleProofLib.sol"; import { SafeTransferLib } from "@solady/utils/SafeTransferLib.sol"; +import { Multicallable } from "@solady/utils/Multicallable.sol"; import { IFeeConfig } from "../../interface/common/IFeeConfig.sol"; import { IPermission } from "../../interface/common/IPermission.sol"; @@ -15,7 +16,7 @@ import { ERC721Hook } from "../ERC721Hook.sol"; import { MintHookERC721Storage } from "../../storage/hook/mint/MintHookERC721Storage.sol"; -contract MintHookERC721 is IFeeConfig, IMintRequest, IClaimCondition, EIP712, ERC721Hook { +contract MintHookERC721 is IFeeConfig, IMintRequest, IClaimCondition, EIP712, ERC721Hook, Multicallable { using ECDSA for bytes32; /*////////////////////////////////////////////////////////////// diff --git a/src/hook/royalty/RoyaltyHook.sol b/src/hook/royalty/RoyaltyHook.sol index dbfe7c36..a384be3e 100644 --- a/src/hook/royalty/RoyaltyHook.sol +++ b/src/hook/royalty/RoyaltyHook.sol @@ -3,13 +3,15 @@ pragma solidity ^0.8.0; /// @author thirdweb +import { Multicallable } from "@solady/utils/Multicallable.sol"; + import { IPermission } from "../../interface/common/IPermission.sol"; import { IRoyaltyInfo } from "../../interface/common/IRoyaltyInfo.sol"; import { ERC1155Hook } from "../ERC1155Hook.sol"; import { RoyaltyHookStorage } from "../../storage/hook/royalty/RoyaltyHookStorage.sol"; -contract RoyaltyHook is IRoyaltyInfo, ERC1155Hook { +contract RoyaltyHook is IRoyaltyInfo, ERC1155Hook, Multicallable { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ diff --git a/test/core/ERC1155Core.t.sol b/test/core/ERC1155Core.t.sol index be644166..8b4396f4 100644 --- a/test/core/ERC1155Core.t.sol +++ b/test/core/ERC1155Core.t.sol @@ -816,6 +816,8 @@ contract ERC1155CoreTest is Test, TestPlus { } function testSafeTransferFromSelf(uint256 id, uint256 mintAmount, uint256 transferAmount, address to) public { + vm.assume(address(0xCAFE) != to); + if (to == address(0)) to = address(0xBEEF); if (uint256(uint160(to)) <= 18 || to.code.length > 0) return;