Skip to content

Commit

Permalink
Code423n4 #34, transfer and safeTransfer similar
Browse files Browse the repository at this point in the history
  • Loading branch information
Splidge committed Jun 16, 2021
1 parent 746b778 commit 5dc5957
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions contracts/nfthubs/RCNftHubL2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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;
}
/*
Expand Down

0 comments on commit 5dc5957

Please sign in to comment.