Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
gracefully handle first minter 0
Browse files Browse the repository at this point in the history
  • Loading branch information
iainnash committed Sep 29, 2023
1 parent 4fafb5a commit b9e0f56
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/abstract/ERC1155/ERC1155Rewards.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ abstract contract ERC1155Rewards is RewardSplits {
) internal returns (uint256) {
uint256 totalReward = computeTotalReward(numTokens);

// If we have no first minter, first minter should be the creator.
if (firstMinter == address(0)) {
firstMinter = creator;
}

if (msgValue < totalReward) {
revert INVALID_ETH_AMOUNT();
} else if (msgValue == totalReward) {
Expand Down

0 comments on commit b9e0f56

Please sign in to comment.