From c33e2fc02b646d927b4be7fe693e6576ff590f4c Mon Sep 17 00:00:00 2001 From: LouisMeMyself Date: Mon, 31 Jan 2022 15:42:49 +0100 Subject: [PATCH] gas optimisation calling require before on createRJLaunchEvent --- contracts/RocketJoeFactory.sol | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contracts/RocketJoeFactory.sol b/contracts/RocketJoeFactory.sol index f0d581bc..ac783c1c 100644 --- a/contracts/RocketJoeFactory.sol +++ b/contracts/RocketJoeFactory.sol @@ -132,10 +132,6 @@ contract RocketJoeFactory is uint256 _userTimelock, uint256 _issuerTimelock ) external override returns (address) { - require( - getRJLaunchEvent[_token] == address(0), - "RJFactory: token has already been issued" - ); require(_issuer != address(0), "RJFactory: issuer can't be 0 address"); require(_token != address(0), "RJFactory: token can't be 0 address"); require(_token != wavax, "RJFactory: token can't be wavax"); @@ -143,6 +139,10 @@ contract RocketJoeFactory is _tokenAmountIncludingIncentives > 0, "RJFactory: token amount including incentives needs to be greater than 0" ); + require( + getRJLaunchEvent[_token] == address(0), + "RJFactory: token has already been issued" + ); require( IJoeFactory(factory).getPair(_token, wavax) == address(0) || IJoePair(IJoeFactory(factory).getPair(_token, wavax))