Skip to content

Commit

Permalink
[G-4] Reduce SLOADs in verifyClaim()
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaryash90 committed Aug 9, 2022
1 parent 6c9056a commit 5f11ac9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions contracts/drop/DropERC20.sol
Expand Up @@ -367,9 +367,12 @@ contract DropERC20 is
currentClaimPhase.supplyClaimed + _quantity <= currentClaimPhase.maxClaimableSupply,
"exceed max mint supply."
);
require(maxTotalSupply == 0 || totalSupply() + _quantity <= maxTotalSupply, "exceed max total supply.");

uint256 _maxTotalSupply = maxTotalSupply;
uint256 _maxWalletClaimCount = maxWalletClaimCount;
require(_maxTotalSupply == 0 || totalSupply() + _quantity <= _maxTotalSupply, "exceed max total supply.");
require(
maxWalletClaimCount == 0 || walletClaimCount[_claimer] + _quantity <= maxWalletClaimCount,
_maxWalletClaimCount == 0 || walletClaimCount[_claimer] + _quantity <= _maxWalletClaimCount,
"exceed claim limit for wallet"
);

Expand Down

0 comments on commit 5f11ac9

Please sign in to comment.