diff --git a/src/clones/ERC1155ContractMetadataCloneable.sol b/src/clones/ERC1155ContractMetadataCloneable.sol index 9c404fa3..9e6a6500 100644 --- a/src/clones/ERC1155ContractMetadataCloneable.sol +++ b/src/clones/ERC1155ContractMetadataCloneable.sol @@ -354,9 +354,10 @@ contract ERC1155ContractMetadataCloneable is ) internal virtual override { if (from != address(0) && to != address(0)) { // Call the transfer validator if one is set. - if (_transferValidator != address(0)) { + address transferValidator = _transferValidator; + if (transferValidator != address(0)) { for (uint256 i = 0; i < ids.length; i++) { - ITransferValidator1155(_transferValidator).validateTransfer( + ITransferValidator1155(transferValidator).validateTransfer( msg.sender, from, to, diff --git a/src/lib/ERC1155ContractMetadata.sol b/src/lib/ERC1155ContractMetadata.sol index 83aab9cd..ffa349fc 100644 --- a/src/lib/ERC1155ContractMetadata.sol +++ b/src/lib/ERC1155ContractMetadata.sol @@ -352,9 +352,10 @@ contract ERC1155ContractMetadata is ) internal virtual override { if (from != address(0) && to != address(0)) { // Call the transfer validator if one is set. - if (_transferValidator != address(0)) { + address transferValidator = _transferValidator; + if (transferValidator != address(0)) { for (uint256 i = 0; i < ids.length; i++) { - ITransferValidator1155(_transferValidator).validateTransfer( + ITransferValidator1155(transferValidator).validateTransfer( msg.sender, from, to, diff --git a/src/lib/ERC721ContractMetadata.sol b/src/lib/ERC721ContractMetadata.sol index ee086380..d82887d7 100644 --- a/src/lib/ERC721ContractMetadata.sol +++ b/src/lib/ERC721ContractMetadata.sol @@ -314,8 +314,9 @@ contract ERC721ContractMetadata is ) internal virtual override { if (from != address(0) && to != address(0)) { // Call the transfer validator if one is set. - if (_transferValidator != address(0)) { - ITransferValidator721(_transferValidator).validateTransfer( + address transferValidator = _transferValidator; + if (transferValidator != address(0)) { + ITransferValidator721(transferValidator).validateTransfer( msg.sender, from, to,