Skip to content

Commit

Permalink
setter for modulus
Browse files Browse the repository at this point in the history
  • Loading branch information
TForge1 committed Oct 13, 2024
1 parent 6ea33fa commit 9690801
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions contracts/LottFund.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ contract LottFund is VRFConsumerBaseV2Plus, ILottFund, AddressProviderResolver,
uint256 public maxBidAmount = 1500;
uint256 public amountToBeBurnt = 5;
uint256 public maxBidsPerAddress = 150
uint256 public maxModulusForToken = 2;
uint256 public bidsAmount;
bool private nativePayment = true;
mapping(uint256 tokenId => uint256 bids) public tokenBidCount;
Expand Down Expand Up @@ -212,7 +213,7 @@ contract LottFund is VRFConsumerBaseV2Plus, ILottFund, AddressProviderResolver,
function canTokenBeBidded(uint256 tokenId) external view returns (bool){
ITraitForgeNft traitForgeNft = _getTraitForgeNft();
entropy = traitForgeNft.getTokenEntropy(tokenId); // get entities 6 digit entropy
maxBidPotential = entropy % 2; // calculation for maxBidPotenital from entropy eg 999999 =
maxBidPotential = entropy % maxModulusForToken; // calculation for maxBidPotenital from entropy eg 999999 =
if(entropy == 999_999){ // if golden god (999999) maxBidPotential is +1 over max
maxBidPotential = 3
}
Expand Down Expand Up @@ -240,7 +241,7 @@ contract LottFund is VRFConsumerBaseV2Plus, ILottFund, AddressProviderResolver,
function getMaxBidPotential(tokenId) public view returns (uint256) {
ITraitForgeNft traitForgeNft = _getTraitForgeNft();
entropy = traitForgeNft.getTokenEntropy(tokenId);
maxBidPotential = entropy % 2;
maxBidPotential = entropy % maxModulusForToken;
return maxBidPotential;
}

Expand Down Expand Up @@ -282,6 +283,10 @@ contract LottFund is VRFConsumerBaseV2Plus, ILottFund, AddressProviderResolver,
maxAllowedClaimDivisor = _divisor;
}

function setMaxModulusForToken(uint256 _number) external onlyProtocolMaintainer{
maxModulusForToken = _number
}

function setNukeFactorMaxParam(uint256 _nukeFactorMaxParam) external onlyProtocolMaintainer {
require(_nukeFactorMaxParam <= MAX_DENOMINATOR, "Invalid nuke factor parameter.");
nukeFactorMaxParam = _nukeFactorMaxParam;
Expand Down

0 comments on commit 9690801

Please sign in to comment.