From b9e0f5610b51b654111ad09d647d2bb1e96039a9 Mon Sep 17 00:00:00 2001 From: iain nash Date: Thu, 28 Sep 2023 23:07:56 -0400 Subject: [PATCH] gracefully handle first minter 0 --- src/abstract/ERC1155/ERC1155Rewards.sol | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/abstract/ERC1155/ERC1155Rewards.sol b/src/abstract/ERC1155/ERC1155Rewards.sol index c4c5cb6..422f1c1 100644 --- a/src/abstract/ERC1155/ERC1155Rewards.sol +++ b/src/abstract/ERC1155/ERC1155Rewards.sol @@ -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) {