diff --git a/NFTStakingV3-BringYourOwnNFTCollection.sol b/NFTStakingV3-BringYourOwnNFTCollection.sol index 352bfd8..f1f30bb 100644 --- a/NFTStakingV3-BringYourOwnNFTCollection.sol +++ b/NFTStakingV3-BringYourOwnNFTCollection.sol @@ -120,7 +120,7 @@ contract NFTStaking is Ownable, IERC721Receiver { require(staked.owner == account, "not an owner"); uint256 stakedAt = staked.timestamp; rewardmath = 100 ether * (block.timestamp - stakedAt) / 86400 ; - earned = rewardmath / 100; + earned += rewardmath / 100; vault[tokenId] = Stake({ owner: account, tokenId: uint24(tokenId), @@ -147,7 +147,7 @@ contract NFTStaking is Ownable, IERC721Receiver { require(staked.owner == account, "not an owner"); uint256 stakedAt = staked.timestamp; rewardmath = 100 ether * (block.timestamp - stakedAt) / 86400; - earned = rewardmath / 100; + earned += rewardmath / 100; } if (earned > 0) {