From 5147a36f80b32826c5228d6ec23bf52110fd51ac Mon Sep 17 00:00:00 2001 From: Splidge <73956628+Splidge@users.noreply.github.com> Date: Mon, 21 Jun 2021 11:52:53 +0100 Subject: [PATCH] Code423n4 #82, check nfthub set before using it --- contracts/RCFactory.sol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contracts/RCFactory.sol b/contracts/RCFactory.sol index d2056899..839cfff4 100644 --- a/contracts/RCFactory.sol +++ b/contracts/RCFactory.sol @@ -480,6 +480,9 @@ contract RCFactory is Ownable, NativeMetaTransaction, IRCFactory { ) external returns (address) { address _creator = msgSender(); + // check nfthub has been set + require(address(nfthub) != address(0), "Nfthub not set"); + // check sponsorship require( _sponsorship >= sponsorshipRequired, @@ -603,7 +606,6 @@ contract RCFactory is Ownable, NativeMetaTransaction, IRCFactory { }); // create the NFTs - require(address(nfthub) != address(0), "Nfthub not set"); for (uint256 i = 0; i < _tokenURIs.length; i++) { uint256 _tokenId = i + totalNftMintCount; require(