You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function _beforeTokenTransfer of RCNftHubL2 can be optimized for gas. This will save the users gas on all future NFT transfers.
See Recommended Mitigation Steps for a suggestion.
Handle
gpersoon
Vulnerability details
Impact
The function _beforeTokenTransfer of RCNftHubL2 can be optimized for gas. This will save the users gas on all future NFT transfers.
See Recommended Mitigation Steps for a suggestion.
Proof of Concept
//https://github.com/code-423n4/2021-08-realitycards/blob/main/contracts/nfthubs/RCNftHubL2.sol#L204
function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override(ERC721Enumerable, ERC721) {
super._beforeTokenTransfer(from, to, tokenId);
Tools Used
Recommended Mitigation Steps
Use something like the following code:
IRCMarket market = IRCMarket(marketTracker[tokenId]);
if (msgSender() != address(factory) && msgSender() != address(market)) {
IRCMarket.States mstate=market.state();
require(mstate == IRCMarket.States.WITHDRAW || mstate == IRCMarket.States.LOCKED,"Incorrect state");
}
}
The text was updated successfully, but these errors were encountered: