From 5dc5957bbc3a810ecdcffe94aa31ba4cae169830 Mon Sep 17 00:00:00 2001 From: Splidge <73956628+Splidge@users.noreply.github.com> Date: Wed, 16 Jun 2021 13:42:48 +0100 Subject: [PATCH] Code423n4 #34, transfer and safeTransfer similar --- contracts/nfthubs/RCNftHubL2.sol | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/contracts/nfthubs/RCNftHubL2.sol b/contracts/nfthubs/RCNftHubL2.sol index f9eab0aa..e1cedaaa 100644 --- a/contracts/nfthubs/RCNftHubL2.sol +++ b/contracts/nfthubs/RCNftHubL2.sol @@ -213,10 +213,7 @@ contract RCNftHubL2 is address to, uint256 tokenId ) public override { - IRCMarket market = IRCMarket(marketTracker[tokenId]); - require(market.state() == IRCMarket.States.WITHDRAW, "Incorrect state"); - require(ownerOf(tokenId) == msgSender(), "Not owner"); - _transfer(from, to, tokenId); + executeTransfer(from, to, tokenId); } function safeTransferFrom( @@ -225,11 +222,19 @@ contract RCNftHubL2 is uint256 tokenId, bytes memory _data ) public override { + executeTransfer(from, to, tokenId); + _data; + } + + function executeTransfer( + address from, + address to, + uint256 tokenId + ) internal { IRCMarket market = IRCMarket(marketTracker[tokenId]); require(market.state() == IRCMarket.States.WITHDRAW, "Incorrect state"); require(ownerOf(tokenId) == msgSender(), "Not owner"); _transfer(from, to, tokenId); - _data; } /* ▲