From 3990f28f1f17aaf0b8df7b556d2976d8c6f8e2b5 Mon Sep 17 00:00:00 2001 From: Splidge Date: Wed, 25 Aug 2021 13:48:52 +0100 Subject: [PATCH] tokenURI math improvements --- contracts/RCFactory.sol | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/contracts/RCFactory.sol b/contracts/RCFactory.sol index 441a4d2a..d832c9c6 100644 --- a/contracts/RCFactory.sol +++ b/contracts/RCFactory.sol @@ -696,10 +696,8 @@ contract RCFactory is NativeMetaTransaction, IRCFactory { /// @dev we want different tokenURIs for originals and copies /// @dev ..the copies are appended to the end of the array /// @dev ..so half the array length if the number of tokens. - require( - (_tokenURIs.length / 2) <= cardLimit, - "Too many tokens to mint" - ); + require(_tokenURIs.length <= cardLimit * 2, "Too many tokens to mint"); + require(_tokenURIs.length % 2 == 0, "TokenURI Length Error"); // check stakeholder addresses // artist @@ -714,7 +712,7 @@ contract RCFactory is NativeMetaTransaction, IRCFactory { // affiliate require( _cardAffiliateAddresses.length == 0 || - _cardAffiliateAddresses.length == (_tokenURIs.length / 2), + _cardAffiliateAddresses.length * 2 == _tokenURIs.length, "Card Affiliate Length Error" ); if (approvedAffiliatesOnly) {