🎮Game
Rule
Entry Ticket
pragma solidity ^0.8.0;
library EntryFeeCalculator {
function getEntryFee(uint256 round) public pure returns (uint256) {
require(round >= 1, "Round must be >= 1");
if (round <= 100) {
// Linear increase: starts at 1e18 and adds 0.25e18 per round
return 1e18 + (round - 1) * 25e16; // 0.25 * 1e18
}
// Final value of round 100 used as base for compound growth
uint256 base100 = 1e18 + 99 * 25e16; // 25.75e18
if (round <= 300) {
// 1% compound growth from round 101 to 300
uint256 exp = round - 100;
return compoundWithBasis(base100, 101, 100, exp);
}
// For round > 300
// Use the result of round 300 as base for further 2% compound growth
uint256 base300 = compoundWithBasis(base100, 101, 100, 200); // round 300 value
uint256 exp = round - 300;
return compoundWithBasis(base300, 102, 100, exp); // 2% compound growth
}
function compoundWithBasis(
uint256 base,
uint256 numerator,
uint256 denominator,
uint256 exponent
) internal pure returns (uint256 result) {
result = base * _pow(numerator, exponent) / _pow(denominator, exponent);
}
function _pow(uint256 x, uint256 n) internal pure returns (uint256 result) {
result = 1;
while (n > 0) {
if (n % 2 == 1) result = result * x;
x = x * x;
n /= 2;
}
}
}Coupon
Prize Distribution Model
Player Count
Last Winner
Random Consolation
Staking Rewards
DAO Treasury
Prize
Last updated