编译器
0.8.21+commit.d9974bed
文件 1 的 17:BurnInfo.sol
pragma solidity ^0.8.10;
import "../libs/constant.sol";
import "../libs/enum.sol";
abstract contract BurnInfo {
uint256 private s_totalTitanBurned;
mapping(address => uint256) private s_userBurnAmount;
mapping(address => uint256) private s_project_BurnAmount;
mapping(address => mapping(address => uint256)) private s_projectUser_BurnAmount;
mapping(uint256 => uint256) private s_cycle28TotalBurn;
mapping(address => mapping(uint256 => uint256)) private s_userCycle28TotalBurn;
mapping(uint256 => uint256) private s_cycle28BurnPayoutPerToken;
event TitanBurned(
address indexed user,
address indexed project,
uint256 indexed burnPoolCycleIndex,
uint256 amount,
BurnSource titanSource
);
function _updateBurnAmount(
address user,
address project,
uint256 amount,
uint256 cycleIndex,
BurnSource source
) internal {
s_userBurnAmount[user] += amount;
s_totalTitanBurned += amount;
s_cycle28TotalBurn[cycleIndex] += amount;
s_userCycle28TotalBurn[user][cycleIndex] += amount;
if (project != address(0)) {
s_project_BurnAmount[project] += amount;
s_projectUser_BurnAmount[project][user] += amount;
}
emit TitanBurned(user, project, cycleIndex, amount, source);
}
function _calculateCycleBurnRewardPerToken(
uint256 cycleIndex,
uint256 reward,
uint256 cycleBurnAmount
) internal {
s_cycle28BurnPayoutPerToken[cycleIndex] = (reward * SCALING_FACTOR_1e18) / cycleBurnAmount;
}
function getUserBurnAmplifierBonus(address user) public view returns (uint256) {
uint256 userBurnTotal = getUserBurnTotal(user);
if (userBurnTotal == 0) return 0;
if (userBurnTotal >= MAX_BURN_AMP_BASE) return MAX_BURN_AMP_PERCENT;
return (MAX_BURN_AMP_PERCENT * userBurnTotal) / MAX_BURN_AMP_BASE;
}
function getTotalBurnTotal() public view returns (uint256) {
return s_totalTitanBurned;
}
function getUserBurnTotal(address user) public view returns (uint256) {
return s_userBurnAmount[user];
}
function getProjectBurnTotal(address contractAddress) public view returns (uint256) {
return s_project_BurnAmount[contractAddress];
}
function getProjectUserBurnTotal(
address contractAddress,
address user
) public view returns (uint256) {
return s_projectUser_BurnAmount[contractAddress][user];
}
function getCycleBurnTotal(uint256 cycleIndex) public view returns (uint256) {
return s_cycle28TotalBurn[cycleIndex];
}
function _getUserCycleBurnTotal(
address user,
uint256 cycleIndex
) internal view returns (uint256) {
return s_userCycle28TotalBurn[user][cycleIndex];
}
function getCycleBurnPayoutPerToken(uint256 cycleIndex) public view returns (uint256) {
return s_cycle28BurnPayoutPerToken[cycleIndex];
}
}
文件 2 的 17:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 3 的 17:ERC20.sol
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
function allowance(
address owner,
address spender
) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}
function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
}
文件 4 的 17:GlobalInfo.sol
pragma solidity ^0.8.10;
import "../libs/enum.sol";
import "../libs/constant.sol";
abstract contract GlobalInfo {
uint256 private immutable i_genesisTs;
uint256 private s_currentContractDay;
uint72 private s_currentshareRate;
uint64 private s_currentMintCost;
uint96 private s_currentMintableTitan;
uint32 private s_currentMintPowerBonus;
uint32 private s_currentEAABonus;
PayoutTriggered private s_isGlobalPayoutTriggered;
mapping(uint256 => uint256) private s_cyclePayouts;
mapping(uint256 => uint256) private s_cyclePayoutIndex;
mapping(uint256 => mapping(uint256 => CycleRewardPerShare)) private s_cyclePayoutPerShare;
mapping(address => mapping(uint256 => UserCycleClaimIndex))
private s_addressCycleToLastClaimIndex;
mapping(uint256 => uint256) s_nextCyclePayoutDay;
struct CycleRewardPerShare {
uint256 day;
uint256 payoutPerShare;
}
struct UserCycleClaimIndex {
uint96 cycleIndex;
uint96 burnCycleIndex;
uint64 sharesIndex;
}
event GlobalDailyUpdateStats(
uint256 indexed day,
uint256 indexed mintCost,
uint256 indexed shareRate,
uint256 mintableTitan,
uint256 mintPowerBonus,
uint256 EAABonus
);
modifier dailyUpdate() {
_dailyUpdate();
_;
}
constructor() {
i_genesisTs = block.timestamp;
s_currentContractDay = 1;
s_currentMintCost = uint64(START_MAX_MINT_COST);
s_currentMintableTitan = uint96(START_MAX_MINTABLE_PER_DAY);
s_currentshareRate = uint72(START_SHARE_RATE);
s_currentMintPowerBonus = uint32(START_MINTPOWER_INCREASE_BONUS);
s_currentEAABonus = uint32(EAA_START);
s_nextCyclePayoutDay[DAY8] = DAY8;
s_nextCyclePayoutDay[DAY28] = DAY28;
s_nextCyclePayoutDay[DAY90] = DAY90;
s_nextCyclePayoutDay[DAY369] = DAY369;
s_nextCyclePayoutDay[DAY888] = DAY888;
}
function _dailyUpdate() private {
uint256 currentContractDay = s_currentContractDay;
uint256 currentBlockDay = ((block.timestamp - i_genesisTs) / 1 days) + 1;
if (currentBlockDay > currentContractDay) {
uint256 newMintCost = s_currentMintCost;
uint256 newShareRate = s_currentshareRate;
uint256 newMintableTitan = s_currentMintableTitan;
uint256 newMintPowerBonus = s_currentMintPowerBonus;
uint256 newEAABonus = s_currentEAABonus;
uint256 dayDifference = currentBlockDay - currentContractDay;
for (uint256 i; i < dayDifference; i++) {
newMintCost = (newMintCost * DAILY_MINT_COST_INCREASE_STEP) / PERCENT_BPS;
newShareRate = (newShareRate * DAILY_SHARE_RATE_INCREASE_STEP) / PERCENT_BPS;
newMintableTitan =
(newMintableTitan * DAILY_SUPPLY_MINTABLE_REDUCTION) /
PERCENT_BPS;
newMintPowerBonus =
(newMintPowerBonus * DAILY_MINTPOWER_INCREASE_BONUS_REDUCTION) /
PERCENT_BPS;
if (newMintCost > 1 ether) {
newMintCost = CAPPED_MAX_MINT_COST;
}
if (newShareRate > CAPPED_MAX_RATE) newShareRate = CAPPED_MAX_RATE;
if (newMintableTitan < CAPPED_MIN_DAILY_TITAN_MINTABLE) {
newMintableTitan = CAPPED_MIN_DAILY_TITAN_MINTABLE;
}
if (newMintPowerBonus < CAPPED_MIN_MINTPOWER_BONUS) {
newMintPowerBonus = CAPPED_MIN_MINTPOWER_BONUS;
}
if (currentBlockDay <= MAX_BONUS_DAY) {
newEAABonus -= EAA_BONUSE_FIXED_REDUCTION_PER_DAY;
} else {
newEAABonus = EAA_END;
}
emit GlobalDailyUpdateStats(
++currentContractDay,
newMintCost,
newShareRate,
newMintableTitan,
newMintPowerBonus,
newEAABonus
);
}
s_currentMintCost = uint64(newMintCost);
s_currentshareRate = uint72(newShareRate);
s_currentMintableTitan = uint96(newMintableTitan);
s_currentMintPowerBonus = uint32(newMintPowerBonus);
s_currentEAABonus = uint32(newEAABonus);
s_currentContractDay = currentBlockDay;
s_isGlobalPayoutTriggered = PayoutTriggered.NO;
}
}
function _initFirstSharesCycleIndex(address user, uint256 isFirstShares) internal {
if (isFirstShares == 1) {
if (s_cyclePayoutIndex[DAY8] != 0) {
s_addressCycleToLastClaimIndex[user][DAY8].cycleIndex = uint96(
s_cyclePayoutIndex[DAY8] + 1
);
s_addressCycleToLastClaimIndex[user][DAY28].cycleIndex = uint96(
s_cyclePayoutIndex[DAY28] + 1
);
s_addressCycleToLastClaimIndex[user][DAY90].cycleIndex = uint96(
s_cyclePayoutIndex[DAY90] + 1
);
s_addressCycleToLastClaimIndex[user][DAY369].cycleIndex = uint96(
s_cyclePayoutIndex[DAY369] + 1
);
s_addressCycleToLastClaimIndex[user][DAY888].cycleIndex = uint96(
s_cyclePayoutIndex[DAY888] + 1
);
}
}
}
function _calculateCycleRewardPerShare(
uint256 cycleNo,
uint256 reward,
uint256 globalActiveShares
) internal returns (uint256 index) {
s_cyclePayouts[cycleNo] = 0;
index = ++s_cyclePayoutIndex[cycleNo];
s_cyclePayoutPerShare[cycleNo][index].payoutPerShare =
(reward * SCALING_FACTOR_1e18) /
globalActiveShares;
s_cyclePayoutPerShare[cycleNo][index].day = getCurrentContractDay();
}
function _updateUserClaimIndexes(
address user,
uint256 cycleNo,
uint256 userClaimCycleIndex,
uint256 userClaimSharesIndex
) internal {
if (userClaimCycleIndex != s_addressCycleToLastClaimIndex[user][cycleNo].cycleIndex)
s_addressCycleToLastClaimIndex[user][cycleNo].cycleIndex = uint96(userClaimCycleIndex);
if (userClaimSharesIndex != s_addressCycleToLastClaimIndex[user][cycleNo].sharesIndex)
s_addressCycleToLastClaimIndex[user][cycleNo].sharesIndex = uint64(
userClaimSharesIndex
);
}
function _updateUserBurnCycleClaimIndex(
address user,
uint256 cycleNo,
uint256 userClaimBurnCycleIndex
) internal {
if (userClaimBurnCycleIndex != s_addressCycleToLastClaimIndex[user][cycleNo].burnCycleIndex)
s_addressCycleToLastClaimIndex[user][cycleNo].burnCycleIndex = uint96(
userClaimBurnCycleIndex
);
}
function _setGlobalPayoutTriggered() internal {
s_isGlobalPayoutTriggered = PayoutTriggered.YES;
}
function _setCyclePayoutPool(uint256 cycleNo, uint256 reward) internal {
s_cyclePayouts[cycleNo] += reward;
}
function _setNextCyclePayoutDay(uint256 cycleNo) internal {
uint256 maturityDay = s_nextCyclePayoutDay[cycleNo];
uint256 currentContractDay = s_currentContractDay;
if (currentContractDay >= maturityDay) {
s_nextCyclePayoutDay[cycleNo] +=
cycleNo *
(((currentContractDay - maturityDay) / cycleNo) + 1);
}
}
function getCurrentBlockTimeStamp() public view returns (uint256) {
return block.timestamp;
}
function getCurrentContractDay() public view returns (uint256) {
return s_currentContractDay;
}
function getCurrentMintCost() public view returns (uint256) {
return s_currentMintCost;
}
function getCurrentShareRate() public view returns (uint256) {
return s_currentshareRate;
}
function getCurrentMintableTitan() public view returns (uint256) {
return s_currentMintableTitan;
}
function getCurrentMintPowerBonus() public view returns (uint256) {
return s_currentMintPowerBonus;
}
function getCurrentEAABonus() public view returns (uint256) {
return s_currentEAABonus;
}
function getCurrentCycleIndex(uint256 cycleNo) public view returns (uint256) {
return s_cyclePayoutIndex[cycleNo];
}
function getGlobalPayoutTriggered() public view returns (PayoutTriggered) {
return s_isGlobalPayoutTriggered;
}
function getCyclePayoutPool(uint256 cycleNo) public view returns (uint256) {
return s_cyclePayouts[cycleNo];
}
function getPayoutPerShare(
uint256 cycleNo,
uint256 index
) public view returns (uint256, uint256) {
return (
s_cyclePayoutPerShare[cycleNo][index].payoutPerShare,
s_cyclePayoutPerShare[cycleNo][index].day
);
}
function getUserLastClaimIndex(
address user,
uint256 cycleNo
) public view returns (uint256 cycleIndex, uint256 sharesIndex) {
return (
s_addressCycleToLastClaimIndex[user][cycleNo].cycleIndex,
s_addressCycleToLastClaimIndex[user][cycleNo].sharesIndex
);
}
function getUserLastBurnClaimIndex(
address user,
uint256 cycleNo
) public view returns (uint256 burnCycleIndex) {
return s_addressCycleToLastClaimIndex[user][cycleNo].burnCycleIndex;
}
function genesisTs() public view returns (uint256) {
return i_genesisTs;
}
function getNextCyclePayoutDay(uint256 cycleNo) public view returns (uint256) {
return s_nextCyclePayoutDay[cycleNo];
}
}
文件 5 的 17:IERC165.sol
pragma solidity ^0.8.0;
import "../utils/introspection/IERC165.sol";
文件 6 的 17:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
文件 7 的 17:IERC20Metadata.sol
pragma solidity ^0.8.0;
import "../IERC20.sol";
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
文件 8 的 17:ITITANX.sol
pragma solidity ^0.8.10;
interface ITITANX {
function balanceOf(address account) external returns (uint256);
function getBalance() external;
function mintLPTokens() external;
function burnLPTokens() external;
}
文件 9 的 17:ITitanOnBurn.sol
pragma solidity ^0.8.10;
interface ITitanOnBurn {
function onBurn(address user, uint256 amount) external;
}
文件 10 的 17:MintInfo.sol
pragma solidity ^0.8.10;
import "../libs/calcFunctions.sol";
error TitanX_InvalidMintLength();
error TitanX_InvalidMintPower();
error TitanX_NoMintExists();
error TitanX_MintHasClaimed();
error TitanX_MintNotMature();
error TitanX_MintHasBurned();
abstract contract MintInfo {
uint256 private s_globalTRank;
uint256 private s_globalMintClaim;
uint256 private s_globalMintBurn;
uint256 private s_globalTitanMinting;
uint256 private s_globalTitanMintPenalty;
uint256 private s_globalMintPower;
mapping(address => uint256) private s_addressMId;
mapping(address => mapping(uint256 => TRankInfo)) private s_addressMIdToTRankInfo;
mapping(uint256 => UserMintInfo) private s_tRankToMintInfo;
struct UserMintInfo {
uint8 mintPower;
uint16 numOfDays;
uint96 mintableTitan;
uint48 mintStartTs;
uint48 maturityTs;
uint32 mintPowerBonus;
uint32 EAABonus;
uint128 mintedTitan;
uint64 mintCost;
MintStatus status;
}
struct TRankInfo {
uint256 tRank;
uint256 gMintPower;
}
struct UserMint {
uint256 mId;
uint256 tRank;
uint256 gMintPower;
UserMintInfo mintInfo;
}
event MintStarted(
address indexed user,
uint256 indexed tRank,
uint256 indexed gMintpower,
UserMintInfo userMintInfo
);
event MintClaimed(
address indexed user,
uint256 indexed tRank,
uint256 rewardMinted,
uint256 indexed penalty,
uint256 mintPenalty
);
function _startMint(
address user,
uint256 mintPower,
uint256 numOfDays,
uint256 mintableTitan,
uint256 mintPowerBonus,
uint256 EAABonus,
uint256 burnAmpBonus,
uint256 gMintPower,
uint256 currentTRank,
uint256 mintCost
) internal returns (uint256 mintable) {
if (numOfDays == 0 || numOfDays > MAX_MINT_LENGTH) revert TitanX_InvalidMintLength();
if (mintPower == 0 || mintPower > MAX_MINT_POWER_CAP) revert TitanX_InvalidMintPower();
mintable = calculateMintReward(mintPower, numOfDays, mintableTitan, EAABonus, burnAmpBonus);
UserMintInfo memory userMintInfo = UserMintInfo({
mintPower: uint8(mintPower),
numOfDays: uint16(numOfDays),
mintableTitan: uint96(mintable),
mintPowerBonus: uint32(mintPowerBonus),
EAABonus: uint32(EAABonus),
mintStartTs: uint48(block.timestamp),
maturityTs: uint48(block.timestamp + (numOfDays * SECONDS_IN_DAY)),
mintedTitan: 0,
mintCost: uint64(mintCost),
status: MintStatus.ACTIVE
});
uint256 id = ++s_addressMId[user];
s_addressMIdToTRankInfo[user][id].tRank = currentTRank;
s_addressMIdToTRankInfo[user][id].gMintPower = gMintPower;
s_tRankToMintInfo[currentTRank] = userMintInfo;
emit MintStarted(user, currentTRank, gMintPower, userMintInfo);
}
function _startBatchMint(
address user,
uint256 mintPower,
uint256 numOfDays,
uint256 mintableTitan,
uint256 mintPowerBonus,
uint256 EAABonus,
uint256 burnAmpBonus,
uint256 count,
uint256 mintCost
) internal {
uint256 gMintPower = s_globalMintPower;
uint256 currentTRank = s_globalTRank;
uint256 gMinting = s_globalTitanMinting;
for (uint256 i = 0; i < count; i++) {
gMintPower += mintPower;
gMinting += _startMint(
user,
mintPower,
numOfDays,
mintableTitan,
mintPowerBonus,
EAABonus,
burnAmpBonus,
gMintPower,
++currentTRank,
mintCost
);
}
_updateMintStats(currentTRank, gMintPower, gMinting);
}
function _startbatchMintLadder(
address user,
uint256 mintPower,
uint256 minDay,
uint256 maxDay,
uint256 dayInterval,
uint256 countPerInterval,
uint256 mintableTitan,
uint256 mintPowerBonus,
uint256 EAABonus,
uint256 burnAmpBonus,
uint256 mintCost
) internal {
uint256 gMintPower = s_globalMintPower;
uint256 currentTRank = s_globalTRank;
uint256 gMinting = s_globalTitanMinting;
for (; minDay <= maxDay; minDay += dayInterval) {
for (uint256 j = 0; j < countPerInterval; j++) {
gMintPower += mintPower;
gMinting += _startMint(
user,
mintPower,
minDay,
mintableTitan,
mintPowerBonus,
EAABonus,
burnAmpBonus,
gMintPower,
++currentTRank,
mintCost
);
}
}
_updateMintStats(currentTRank, gMintPower, gMinting);
}
function _updateMintStats(uint256 currentTRank, uint256 gMintPower, uint256 gMinting) internal {
s_globalTRank = currentTRank;
s_globalMintPower = gMintPower;
s_globalTitanMinting = gMinting;
}
function _claimMint(
address user,
uint256 id,
MintAction action
) internal returns (uint256 reward) {
uint256 tRank = s_addressMIdToTRankInfo[user][id].tRank;
uint256 gMintPower = s_addressMIdToTRankInfo[user][id].gMintPower;
if (tRank == 0) revert TitanX_NoMintExists();
UserMintInfo memory mint = s_tRankToMintInfo[tRank];
if (mint.status == MintStatus.CLAIMED) revert TitanX_MintHasClaimed();
if (mint.status == MintStatus.BURNED) revert TitanX_MintHasBurned();
if (mint.maturityTs > block.timestamp && action == MintAction.CLAIM)
revert TitanX_MintNotMature();
s_globalTitanMinting -= mint.mintableTitan;
reward = _calculateClaimReward(user, tRank, gMintPower, mint, action);
}
function _batchClaimMint(address user) internal returns (uint256 reward) {
uint256 maxId = s_addressMId[user];
uint256 claimCount;
uint256 tRank;
uint256 gMinting;
UserMintInfo memory mint;
for (uint256 i = 1; i <= maxId; i++) {
tRank = s_addressMIdToTRankInfo[user][i].tRank;
mint = s_tRankToMintInfo[tRank];
if (mint.status == MintStatus.ACTIVE && block.timestamp >= mint.maturityTs) {
reward += _calculateClaimReward(
user,
tRank,
s_addressMIdToTRankInfo[user][i].gMintPower,
mint,
MintAction.CLAIM
);
gMinting += mint.mintableTitan;
++claimCount;
}
if (claimCount == 100) break;
}
s_globalTitanMinting -= gMinting;
}
function _calculateClaimReward(
address user,
uint256 tRank,
uint256 gMintPower,
UserMintInfo memory userMintInfo,
MintAction action
) private returns (uint256 reward) {
if (action == MintAction.CLAIM) s_tRankToMintInfo[tRank].status = MintStatus.CLAIMED;
if (action == MintAction.BURN) s_tRankToMintInfo[tRank].status = MintStatus.BURNED;
uint256 penaltyAmount;
uint256 penalty;
uint256 bonus;
if (block.timestamp > userMintInfo.maturityTs) {
penalty = calculateClaimMintPenalty(block.timestamp - userMintInfo.maturityTs);
}
if (action == MintAction.CLAIM) {
bonus = calculateMintPowerBonus(
userMintInfo.mintPowerBonus,
userMintInfo.mintPower,
gMintPower,
s_globalMintPower
);
}
reward = uint256(userMintInfo.mintableTitan) + (bonus / SCALING_FACTOR_1e7);
penaltyAmount = (reward * penalty) / 100;
reward -= penaltyAmount;
if (action == MintAction.CLAIM) ++s_globalMintClaim;
if (action == MintAction.BURN) ++s_globalMintBurn;
if (penaltyAmount != 0) s_globalTitanMintPenalty += penaltyAmount;
if (action == MintAction.CLAIM) s_tRankToMintInfo[tRank].mintedTitan = uint128(reward);
emit MintClaimed(user, tRank, reward, penalty, penaltyAmount);
}
function getUserLatestMintId(address user) public view returns (uint256) {
return s_addressMId[user];
}
function getUserMintInfo(
address user,
uint256 id
) public view returns (UserMintInfo memory mintInfo) {
return s_tRankToMintInfo[s_addressMIdToTRankInfo[user][id].tRank];
}
function getUserMints(address user) public view returns (UserMint[] memory mintInfos) {
uint256 count = s_addressMId[user];
mintInfos = new UserMint[](count);
for (uint256 i = 1; i <= count; i++) {
mintInfos[i - 1] = UserMint({
mId: i,
tRank: s_addressMIdToTRankInfo[user][i].tRank,
gMintPower: s_addressMIdToTRankInfo[user][i].gMintPower,
mintInfo: getUserMintInfo(user, i)
});
}
}
function getTotalMintBurn() public view returns (uint256) {
return s_globalMintBurn;
}
function getGlobalTRank() public view returns (uint256) {
return s_globalTRank;
}
function getGlobalMintPower() public view returns (uint256) {
return s_globalMintPower;
}
function getTotalMintClaim() public view returns (uint256) {
return s_globalMintClaim;
}
function getTotalActiveMints() public view returns (uint256) {
return s_globalTRank - s_globalMintClaim - s_globalMintBurn;
}
function getTotalMinting() public view returns (uint256) {
return s_globalTitanMinting;
}
function getTotalMintPenalty() public view returns (uint256) {
return s_globalTitanMintPenalty;
}
}
文件 11 的 17:OwnerInfo.sol
pragma solidity ^0.8.10;
import "./openzeppelin/utils/Context.sol";
error TitanX_NotOnwer();
abstract contract OwnerInfo is Context {
address private s_owner;
constructor() {
s_owner = _msgSender();
}
modifier onlyOwner() {
_checkOwner();
_;
}
function _checkOwner() internal view virtual {
if (s_owner != _msgSender()) revert TitanX_NotOnwer();
}
function renounceOwnership() public onlyOwner {
_setOwner(address(0));
}
function transferOwnership(address newOwner) public onlyOwner {
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
s_owner = newOwner;
}
}
文件 12 的 17:ReentrancyGuard.sol
pragma solidity ^0.8.0;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
}
function _nonReentrantAfter() private {
_status = _NOT_ENTERED;
}
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}
文件 13 的 17:StakeInfo.sol
pragma solidity ^0.8.10;
import "../libs/calcFunctions.sol";
error TitanX_InvalidStakeLength();
error TitanX_RequireOneMinimumShare();
error TitanX_ExceedMaxAmountPerStake();
error TitanX_NoStakeExists();
error TitanX_StakeHasEnded();
error TitanX_StakeNotMatured();
error TitanX_StakeHasBurned();
error TitanX_MaxedWalletStakes();
abstract contract StakeInfo {
uint256 private s_globalStakeId;
uint256 private s_globalShares;
uint256 private s_globalExpiredShares;
uint256 private s_globalTitanStaked;
uint256 private s_globalStakePenalty;
uint256 private s_globalStakeEnd;
uint256 private s_globalStakeBurn;
mapping(address => uint256) private s_addressSId;
mapping(address => mapping(uint256 => uint256)) private s_addressSIdToGlobalStakeId;
mapping(uint256 => UserStakeInfo) private s_globalStakeIdToStakeInfo;
mapping(address => uint256) private s_userSharesIndex;
mapping(address => mapping(uint256 => UserActiveShares)) private s_addressIdToActiveShares;
struct UserStakeInfo {
uint152 titanAmount;
uint128 shares;
uint16 numOfDays;
uint48 stakeStartTs;
uint48 maturityTs;
StakeStatus status;
}
struct UserStake {
uint256 sId;
uint256 globalStakeId;
UserStakeInfo stakeInfo;
}
struct UserActiveShares {
uint256 day;
uint256 activeShares;
}
event StakeStarted(
address indexed user,
uint256 indexed globalStakeId,
uint256 numOfDays,
UserStakeInfo indexed userStakeInfo
);
event StakeEnded(
address indexed user,
uint256 indexed globalStakeId,
uint256 titanAmount,
uint256 indexed penalty,
uint256 penaltyAmount
);
function _startStake(
address user,
uint256 amount,
uint256 numOfDays,
uint256 shareRate,
uint256 day,
PayoutTriggered isPayoutTriggered
) internal returns (uint256 isFirstShares) {
uint256 sId = ++s_addressSId[user];
if (sId > MAX_STAKE_PER_WALLET) revert TitanX_MaxedWalletStakes();
if (numOfDays < MIN_STAKE_LENGTH || numOfDays > MAX_STAKE_LENGTH)
revert TitanX_InvalidStakeLength();
uint256 shares = calculateShares(amount, numOfDays, shareRate);
if (shares / SCALING_FACTOR_1e18 < 1) revert TitanX_RequireOneMinimumShare();
uint256 currentGStakeId = ++s_globalStakeId;
uint256 maturityTs;
maturityTs = block.timestamp + (numOfDays * SECONDS_IN_DAY);
UserStakeInfo memory userStakeInfo = UserStakeInfo({
titanAmount: uint152(amount),
shares: uint128(shares),
numOfDays: uint16(numOfDays),
stakeStartTs: uint48(block.timestamp),
maturityTs: uint48(maturityTs),
status: StakeStatus.ACTIVE
});
s_addressSIdToGlobalStakeId[user][sId] = currentGStakeId;
s_globalStakeIdToStakeInfo[currentGStakeId] = userStakeInfo;
isFirstShares = _updateSharesStats(
user,
shares,
amount,
day,
isPayoutTriggered,
StakeAction.START
);
emit StakeStarted(user, currentGStakeId, numOfDays, userStakeInfo);
}
function _endStake(
address user,
uint256 id,
uint256 day,
StakeAction action,
StakeAction payOther,
PayoutTriggered isPayoutTriggered
) internal returns (uint256 titan) {
uint256 globalStakeId = s_addressSIdToGlobalStakeId[user][id];
if (globalStakeId == 0) revert TitanX_NoStakeExists();
UserStakeInfo memory userStakeInfo = s_globalStakeIdToStakeInfo[globalStakeId];
if (userStakeInfo.status == StakeStatus.ENDED) revert TitanX_StakeHasEnded();
if (userStakeInfo.status == StakeStatus.BURNED) revert TitanX_StakeHasBurned();
if (payOther == StakeAction.END_OTHER && block.timestamp < userStakeInfo.maturityTs)
revert TitanX_StakeNotMatured();
uint256 shares = userStakeInfo.shares;
_updateSharesStats(user, shares, userStakeInfo.titanAmount, day, isPayoutTriggered, action);
if (action == StakeAction.END) {
++s_globalStakeEnd;
s_globalStakeIdToStakeInfo[globalStakeId].status = StakeStatus.ENDED;
} else if (action == StakeAction.BURN) {
++s_globalStakeBurn;
s_globalStakeIdToStakeInfo[globalStakeId].status = StakeStatus.BURNED;
}
titan = _calculatePrinciple(user, globalStakeId, userStakeInfo, action);
}
function _updateSharesStats(
address user,
uint256 shares,
uint256 amount,
uint256 day,
PayoutTriggered isPayoutTriggered,
StakeAction action
) private returns (uint256 isFirstShares) {
uint256 index = s_userSharesIndex[user];
uint256 previousShares = s_addressIdToActiveShares[user][index].activeShares;
if (action == StakeAction.START) {
if (index == 0) isFirstShares = 1;
s_addressIdToActiveShares[user][++index].activeShares = previousShares + shares;
s_globalShares += shares;
s_globalTitanStaked += amount;
} else {
s_addressIdToActiveShares[user][++index].activeShares = previousShares - shares;
s_globalExpiredShares += shares;
s_globalTitanStaked -= amount;
}
s_addressIdToActiveShares[user][index].day = uint128(
isPayoutTriggered == PayoutTriggered.NO ? day : day + 1
);
s_userSharesIndex[user] = index;
}
function _calculatePrinciple(
address user,
uint256 globalStakeId,
UserStakeInfo memory userStakeInfo,
StakeAction action
) internal returns (uint256 principle) {
uint256 titanAmount = userStakeInfo.titanAmount;
uint256 penalty = calculateEndStakePenalty(
userStakeInfo.stakeStartTs,
userStakeInfo.maturityTs,
block.timestamp,
action
);
uint256 penaltyAmount;
penaltyAmount = (titanAmount * penalty) / 100;
principle = titanAmount - penaltyAmount;
s_globalStakePenalty += penaltyAmount;
emit StakeEnded(user, globalStakeId, principle, penalty, penaltyAmount);
}
function getGlobalShares() public view returns (uint256) {
return s_globalShares;
}
function getGlobalExpiredShares() public view returns (uint256) {
return s_globalExpiredShares;
}
function getGlobalActiveShares() public view returns (uint256) {
return s_globalShares - s_globalExpiredShares;
}
function getTotalTitanStaked() public view returns (uint256) {
return s_globalTitanStaked;
}
function getGlobalStakeId() public view returns (uint256) {
return s_globalStakeId;
}
function getGlobalActiveStakes() public view returns (uint256) {
return s_globalStakeId - getTotalStakeEnd();
}
function getTotalStakeEnd() public view returns (uint256) {
return s_globalStakeEnd;
}
function getTotalStakeBurn() public view returns (uint256) {
return s_globalStakeBurn;
}
function getTotalStakePenalty() public view returns (uint256) {
return s_globalStakePenalty;
}
function getUserLatestShareIndex(address user) public view returns (uint256) {
return s_userSharesIndex[user];
}
function getUserCurrentActiveShares(address user) public view returns (uint256) {
return s_addressIdToActiveShares[user][getUserLatestShareIndex(user)].activeShares;
}
function getUserActiveShares(
address user,
uint256 sharesIndex
) internal view returns (uint256) {
return s_addressIdToActiveShares[user][sharesIndex].activeShares;
}
function getUserActiveSharesDay(
address user,
uint256 sharesIndex
) internal view returns (uint256) {
return s_addressIdToActiveShares[user][sharesIndex].day;
}
function getUserStakeInfo(address user, uint256 id) public view returns (UserStakeInfo memory) {
return s_globalStakeIdToStakeInfo[s_addressSIdToGlobalStakeId[user][id]];
}
function getUserStakes(address user) public view returns (UserStake[] memory) {
uint256 count = s_addressSId[user];
UserStake[] memory stakes = new UserStake[](count);
for (uint256 i = 1; i <= count; i++) {
stakes[i - 1] = UserStake({
sId: i,
globalStakeId: uint128(s_addressSIdToGlobalStakeId[user][i]),
stakeInfo: getUserStakeInfo(user, i)
});
}
return stakes;
}
}
文件 14 的 17:TITANX.sol
pragma solidity ^0.8.10;
import "./openzeppelin/security/ReentrancyGuard.sol";
import "./openzeppelin/token/ERC20/ERC20.sol";
import "./openzeppelin/interfaces/IERC165.sol";
import "../interfaces/ITitanOnBurn.sol";
import "../interfaces/ITITANX.sol";
import "../libs/calcFunctions.sol";
import "./GlobalInfo.sol";
import "./MintInfo.sol";
import "./StakeInfo.sol";
import "./BurnInfo.sol";
import "./OwnerInfo.sol";
error TitanX_InvalidAmount();
error TitanX_InsufficientBalance();
error TitanX_NotSupportedContract();
error TitanX_InsufficientProtocolFees();
error TitanX_FailedToSendAmount();
error TitanX_NotAllowed();
error TitanX_NoCycleRewardToClaim();
error TitanX_NoSharesExist();
error TitanX_EmptyUndistributeFees();
error TitanX_InvalidBurnRewardPercent();
error TitanX_InvalidBatchCount();
error TitanX_InvalidMintLadderInterval();
error TitanX_InvalidMintLadderRange();
error TitanX_MaxedWalletMints();
error TitanX_LPTokensHasMinted();
error TitanX_InvalidAddress();
error TitanX_InsufficientBurnAllowance();
contract TITANX is ERC20, ReentrancyGuard, GlobalInfo, MintInfo, StakeInfo, BurnInfo, OwnerInfo {
address private s_genesisAddress;
address private s_buyAndBurnAddress;
uint88 private s_undistributedEth;
uint88 private s_cycleBurnReward;
InitialLPMinted private s_initialLPMinted;
BurnPoolEnabled private s_burnPoolEnabled;
mapping(address => mapping(address => uint256)) private s_allowanceBurnMints;
mapping(address => mapping(address => uint256)) private s_allowanceBurnStakes;
event ProtocolFeeRecevied(address indexed user, uint256 indexed day, uint256 indexed amount);
event ETHDistributed(address indexed caller, uint256 indexed amount);
event CyclePayoutTriggered(
address indexed caller,
uint256 indexed cycleNo,
uint256 indexed reward,
uint256 burnReward
);
event RewardClaimed(address indexed user, uint256 indexed reward);
event ApproveBurnStakes(address indexed user, address indexed project, uint256 indexed amount);
event ApproveBurnMints(address indexed user, address indexed project, uint256 indexed amount);
constructor(address genesisAddress, address buyAndBurnAddress) ERC20("TITAN X", "TITANX") {
if (genesisAddress == address(0)) revert TitanX_InvalidAddress();
if (buyAndBurnAddress == address(0)) revert TitanX_InvalidAddress();
s_genesisAddress = genesisAddress;
s_buyAndBurnAddress = buyAndBurnAddress;
}
function startMint(
uint256 mintPower,
uint256 numOfDays
) external payable nonReentrant dailyUpdate {
if (getUserLatestMintId(_msgSender()) + 1 > MAX_MINT_PER_WALLET)
revert TitanX_MaxedWalletMints();
uint256 gMintPower = getGlobalMintPower() + mintPower;
uint256 currentTRank = getGlobalTRank() + 1;
uint256 gMinting = getTotalMinting() +
_startMint(
_msgSender(),
mintPower,
numOfDays,
getCurrentMintableTitan(),
getCurrentMintPowerBonus(),
getCurrentEAABonus(),
getUserBurnAmplifierBonus(_msgSender()),
gMintPower,
currentTRank,
getBatchMintCost(mintPower, 1, getCurrentMintCost())
);
_updateMintStats(currentTRank, gMintPower, gMinting);
_protocolFees(mintPower, 1);
}
function batchMint(
uint256 mintPower,
uint256 numOfDays,
uint256 count
) external payable nonReentrant dailyUpdate {
if (count == 0 || count > MAX_BATCH_MINT_COUNT) revert TitanX_InvalidBatchCount();
if (getUserLatestMintId(_msgSender()) + count > MAX_MINT_PER_WALLET)
revert TitanX_MaxedWalletMints();
_startBatchMint(
_msgSender(),
mintPower,
numOfDays,
getCurrentMintableTitan(),
getCurrentMintPowerBonus(),
getCurrentEAABonus(),
getUserBurnAmplifierBonus(_msgSender()),
count,
getBatchMintCost(mintPower, 1, getCurrentMintCost())
);
_protocolFees(mintPower, count);
}
function batchMintLadder(
uint256 mintPower,
uint256 minDay,
uint256 maxDay,
uint256 dayInterval,
uint256 countPerInterval
) external payable nonReentrant dailyUpdate {
if (dayInterval == 0) revert TitanX_InvalidMintLadderInterval();
if (maxDay < minDay || minDay == 0 || maxDay > MAX_MINT_LENGTH)
revert TitanX_InvalidMintLadderRange();
uint256 count = getBatchMintLadderCount(minDay, maxDay, dayInterval, countPerInterval);
if (count == 0 || count > MAX_BATCH_MINT_COUNT) revert TitanX_InvalidBatchCount();
if (getUserLatestMintId(_msgSender()) + count > MAX_MINT_PER_WALLET)
revert TitanX_MaxedWalletMints();
uint256 mintCost = getBatchMintCost(mintPower, 1, getCurrentMintCost());
_startbatchMintLadder(
_msgSender(),
mintPower,
minDay,
maxDay,
dayInterval,
countPerInterval,
getCurrentMintableTitan(),
getCurrentMintPowerBonus(),
getCurrentEAABonus(),
getUserBurnAmplifierBonus(_msgSender()),
mintCost
);
_protocolFees(mintPower, count);
}
function claimMint(uint256 id) external dailyUpdate nonReentrant {
_mintReward(_claimMint(_msgSender(), id, MintAction.CLAIM));
}
function batchClaimMint() external dailyUpdate nonReentrant {
_mintReward(_batchClaimMint(_msgSender()));
}
function startStake(uint256 amount, uint256 numOfDays) external dailyUpdate nonReentrant {
if (balanceOf(_msgSender()) < amount) revert TitanX_InsufficientBalance();
_burn(_msgSender(), amount);
_initFirstSharesCycleIndex(
_msgSender(),
_startStake(
_msgSender(),
amount,
numOfDays,
getCurrentShareRate(),
getCurrentContractDay(),
getGlobalPayoutTriggered()
)
);
}
function endStake(uint256 id) external dailyUpdate nonReentrant {
_mint(
_msgSender(),
_endStake(
_msgSender(),
id,
getCurrentContractDay(),
StakeAction.END,
StakeAction.END_OWN,
getGlobalPayoutTriggered()
)
);
}
function endStakeForOthers(address user, uint256 id) external dailyUpdate nonReentrant {
_mint(
user,
_endStake(
user,
id,
getCurrentContractDay(),
StakeAction.END,
StakeAction.END_OTHER,
getGlobalPayoutTriggered()
)
);
}
function distributeETH() external dailyUpdate nonReentrant {
(uint256 incentiveFee, uint256 buyAndBurnFunds, uint256 genesisWallet) = _distributeETH();
_sendFunds(incentiveFee, buyAndBurnFunds, genesisWallet);
}
function triggerPayouts() external dailyUpdate nonReentrant {
uint256 globalActiveShares = getGlobalShares() - getGlobalExpiredShares();
if (globalActiveShares < 1) revert TitanX_NoSharesExist();
uint256 incentiveFee;
uint256 buyAndBurnFunds;
uint256 genesisWallet;
if (s_undistributedEth != 0)
(incentiveFee, buyAndBurnFunds, genesisWallet) = _distributeETH();
uint256 currentContractDay = getCurrentContractDay();
PayoutTriggered isTriggered = PayoutTriggered.NO;
_triggerCyclePayout(DAY8, globalActiveShares, currentContractDay) == PayoutTriggered.YES &&
isTriggered == PayoutTriggered.NO
? isTriggered = PayoutTriggered.YES
: isTriggered;
_triggerCyclePayout(DAY28, globalActiveShares, currentContractDay) == PayoutTriggered.YES &&
isTriggered == PayoutTriggered.NO
? isTriggered = PayoutTriggered.YES
: isTriggered;
_triggerCyclePayout(DAY90, globalActiveShares, currentContractDay) == PayoutTriggered.YES &&
isTriggered == PayoutTriggered.NO
? isTriggered = PayoutTriggered.YES
: isTriggered;
_triggerCyclePayout(DAY369, globalActiveShares, currentContractDay) ==
PayoutTriggered.YES &&
isTriggered == PayoutTriggered.NO
? isTriggered = PayoutTriggered.YES
: isTriggered;
_triggerCyclePayout(DAY888, globalActiveShares, currentContractDay) ==
PayoutTriggered.YES &&
isTriggered == PayoutTriggered.NO
? isTriggered = PayoutTriggered.YES
: isTriggered;
if (isTriggered == PayoutTriggered.YES) {
if (getGlobalPayoutTriggered() == PayoutTriggered.NO) _setGlobalPayoutTriggered();
}
if (incentiveFee != 0) _sendFunds(incentiveFee, buyAndBurnFunds, genesisWallet);
}
function claimUserAvailableETHPayouts() external dailyUpdate nonReentrant {
uint256 reward = _claimCyclePayout(DAY8, PayoutClaim.SHARES);
reward += _claimCyclePayout(DAY28, PayoutClaim.SHARES);
reward += _claimCyclePayout(DAY90, PayoutClaim.SHARES);
reward += _claimCyclePayout(DAY369, PayoutClaim.SHARES);
reward += _claimCyclePayout(DAY888, PayoutClaim.SHARES);
if (reward == 0) revert TitanX_NoCycleRewardToClaim();
_sendViaCall(payable(_msgSender()), reward);
emit RewardClaimed(_msgSender(), reward);
}
function claimUserAvailableETHBurnPool() external dailyUpdate nonReentrant {
uint256 reward = _claimCyclePayout(DAY28, PayoutClaim.BURN);
if (reward == 0) revert TitanX_NoCycleRewardToClaim();
_sendViaCall(payable(_msgSender()), reward);
emit RewardClaimed(_msgSender(), reward);
}
function setBuyAndBurnContractAddress(address contractAddress) external onlyOwner {
if (contractAddress == address(0)) revert TitanX_InvalidAddress();
s_buyAndBurnAddress = contractAddress;
}
function enableBurnPoolReward() external onlyOwner {
s_burnPoolEnabled = BurnPoolEnabled.TRUE;
}
function setNewGenesisAddress(address newAddress) external {
if (_msgSender() != s_genesisAddress) revert TitanX_NotAllowed();
if (newAddress == address(0)) revert TitanX_InvalidAddress();
s_genesisAddress = newAddress;
}
function mintLPTokens() external {
if (_msgSender() != s_buyAndBurnAddress) revert TitanX_NotAllowed();
if (s_initialLPMinted == InitialLPMinted.YES) revert TitanX_LPTokensHasMinted();
s_initialLPMinted = InitialLPMinted.YES;
_mint(s_buyAndBurnAddress, INITAL_LP_TOKENS);
}
function burnLPTokens() external dailyUpdate {
_burn(s_buyAndBurnAddress, balanceOf(s_buyAndBurnAddress));
}
function _mintReward(uint256 reward) private {
_mint(_msgSender(), reward);
_mint(s_genesisAddress, (reward * 800) / PERCENT_BPS);
}
function _sendFunds(
uint256 incentiveFee,
uint256 buyAndBurnFunds,
uint256 genesisWalletFunds
) private {
_sendViaCall(payable(_msgSender()), incentiveFee);
_sendViaCall(payable(s_genesisAddress), genesisWalletFunds);
_sendViaCall(payable(s_buyAndBurnAddress), buyAndBurnFunds);
}
function _distributeETH()
private
returns (uint256 incentiveFee, uint256 buyAndBurnFunds, uint256 genesisWallet)
{
uint256 accumulatedFees = s_undistributedEth;
if (accumulatedFees == 0) revert TitanX_EmptyUndistributeFees();
s_undistributedEth = 0;
emit ETHDistributed(_msgSender(), accumulatedFees);
incentiveFee = (accumulatedFees * INCENTIVE_FEE_PERCENT) / INCENTIVE_FEE_PERCENT_BASE;
accumulatedFees -= incentiveFee;
buyAndBurnFunds = (accumulatedFees * PERCENT_TO_BUY_AND_BURN) / PERCENT_BPS;
uint256 cylceBurnReward = (accumulatedFees * PERCENT_TO_BURN_PAYOUTS) / PERCENT_BPS;
genesisWallet = (accumulatedFees * PERCENT_TO_GENESIS) / PERCENT_BPS;
uint256 cycleRewardPool = accumulatedFees -
buyAndBurnFunds -
cylceBurnReward -
genesisWallet;
if (s_burnPoolEnabled == BurnPoolEnabled.TRUE) s_cycleBurnReward += uint88(cylceBurnReward);
else buyAndBurnFunds += cylceBurnReward;
if (cycleRewardPool != 0) {
uint256 cycle8Reward = (cycleRewardPool * CYCLE_8_PERCENT) / PERCENT_BPS;
uint256 cycle28Reward = (cycleRewardPool * CYCLE_28_PERCENT) / PERCENT_BPS;
uint256 cycle90Reward = (cycleRewardPool * CYCLE_90_PERCENT) / PERCENT_BPS;
uint256 cycle369Reward = (cycleRewardPool * CYCLE_369_PERCENT) / PERCENT_BPS;
_setCyclePayoutPool(DAY8, cycle8Reward);
_setCyclePayoutPool(DAY28, cycle28Reward);
_setCyclePayoutPool(DAY90, cycle90Reward);
_setCyclePayoutPool(DAY369, cycle369Reward);
_setCyclePayoutPool(
DAY888,
cycleRewardPool - cycle8Reward - cycle28Reward - cycle90Reward - cycle369Reward
);
}
}
function _protocolFees(uint256 mintPower, uint256 count) private {
uint256 protocolFee;
protocolFee = getBatchMintCost(mintPower, count, getCurrentMintCost());
if (msg.value < protocolFee) revert TitanX_InsufficientProtocolFees();
uint256 feeBalance;
s_undistributedEth += uint88(protocolFee);
feeBalance = msg.value - protocolFee;
if (feeBalance != 0) {
_sendViaCall(payable(_msgSender()), feeBalance);
}
emit ProtocolFeeRecevied(_msgSender(), getCurrentContractDay(), protocolFee);
}
function _triggerCyclePayout(
uint256 cycleNo,
uint256 globalActiveShares,
uint256 currentContractDay
) private returns (PayoutTriggered triggered) {
if (currentContractDay < getNextCyclePayoutDay(cycleNo)) return PayoutTriggered.NO;
_setNextCyclePayoutDay(cycleNo);
uint256 reward = getCyclePayoutPool(cycleNo);
if (reward == 0) return PayoutTriggered.NO;
uint256 cycleIndex = _calculateCycleRewardPerShare(cycleNo, reward, globalActiveShares);
uint256 totalCycleBurn = getCycleBurnTotal(cycleIndex);
uint256 burnReward;
if (cycleNo == DAY28 && totalCycleBurn != 0) {
burnReward = s_cycleBurnReward;
if (burnReward != 0) {
s_cycleBurnReward = 0;
_calculateCycleBurnRewardPerToken(cycleIndex, burnReward, totalCycleBurn);
}
}
emit CyclePayoutTriggered(_msgSender(), cycleNo, reward, burnReward);
return PayoutTriggered.YES;
}
function _claimCyclePayout(uint256 cycleNo, PayoutClaim payoutClaim) private returns (uint256) {
(
uint256 reward,
uint256 userClaimCycleIndex,
uint256 userClaimSharesIndex,
uint256 userClaimBurnCycleIndex
) = _calculateUserCycleReward(_msgSender(), cycleNo, payoutClaim);
if (payoutClaim == PayoutClaim.SHARES)
_updateUserClaimIndexes(
_msgSender(),
cycleNo,
userClaimCycleIndex,
userClaimSharesIndex
);
if (payoutClaim == PayoutClaim.BURN) {
_updateUserBurnCycleClaimIndex(_msgSender(), cycleNo, userClaimBurnCycleIndex);
}
return reward;
}
function _burnLiquidTitan(
address user,
uint256 amount,
uint256 userRebatePercentage,
uint256 rewardPaybackPercentage,
address rewardPaybackAddress
) private {
if (amount == 0) revert TitanX_InvalidAmount();
if (balanceOf(user) < amount) revert TitanX_InsufficientBalance();
_spendAllowance(user, _msgSender(), amount);
_burnbefore(userRebatePercentage, rewardPaybackPercentage);
_burn(user, amount);
_burnAfter(
user,
amount,
userRebatePercentage,
rewardPaybackPercentage,
rewardPaybackAddress,
BurnSource.LIQUID
);
}
function _burnStake(
address user,
uint256 id,
uint256 userRebatePercentage,
uint256 rewardPaybackPercentage,
address rewardPaybackAddress
) private {
_spendBurnStakeAllowance(user);
_burnbefore(userRebatePercentage, rewardPaybackPercentage);
_burnAfter(
user,
_endStake(
user,
id,
getCurrentContractDay(),
StakeAction.BURN,
StakeAction.END_OWN,
getGlobalPayoutTriggered()
),
userRebatePercentage,
rewardPaybackPercentage,
rewardPaybackAddress,
BurnSource.STAKE
);
}
function _burnMint(address user, uint256 id) private {
_spendBurnMintAllowance(user);
_burnbefore(0, 0);
uint256 amount = _claimMint(user, id, MintAction.BURN);
_mint(s_genesisAddress, (amount * 800) / PERCENT_BPS);
_burnAfter(user, amount, 0, 0, _msgSender(), BurnSource.MINT);
}
function _burnbefore(
uint256 userRebatePercentage,
uint256 rewardPaybackPercentage
) private view {
if (rewardPaybackPercentage + userRebatePercentage > MAX_BURN_REWARD_PERCENT)
revert TitanX_InvalidBurnRewardPercent();
if (
!IERC165(_msgSender()).supportsInterface(IERC165.supportsInterface.selector) ||
!IERC165(_msgSender()).supportsInterface(type(ITitanOnBurn).interfaceId)
) revert TitanX_NotSupportedContract();
}
function _burnAfter(
address user,
uint256 amount,
uint256 userRebatePercentage,
uint256 rewardPaybackPercentage,
address rewardPaybackAddress,
BurnSource source
) private {
uint256 index = getCurrentCycleIndex(DAY28) + 1;
if (getUserBurnTotal(user) == 0) _updateUserBurnCycleClaimIndex(user, DAY28, index);
_updateBurnAmount(user, _msgSender(), amount, index, source);
uint256 devFee;
uint256 userRebate;
if (rewardPaybackPercentage != 0)
devFee = (amount * rewardPaybackPercentage * PERCENT_BPS) / (100 * PERCENT_BPS);
if (userRebatePercentage != 0)
userRebate = (amount * userRebatePercentage * PERCENT_BPS) / (100 * PERCENT_BPS);
if (devFee != 0) _mint(rewardPaybackAddress, devFee);
if (userRebate != 0) _mint(user, userRebate);
ITitanOnBurn(_msgSender()).onBurn(user, amount);
}
function _sendViaCall(address payable to, uint256 amount) private {
if (to == address(0)) revert TitanX_InvalidAddress();
(bool sent, ) = to.call{value: amount}("");
if (!sent) revert TitanX_FailedToSendAmount();
}
function _spendBurnStakeAllowance(address user) private {
uint256 currentAllowance = allowanceBurnStakes(user, _msgSender());
if (currentAllowance != type(uint256).max) {
if (currentAllowance == 0) revert TitanX_InsufficientBurnAllowance();
--s_allowanceBurnStakes[user][_msgSender()];
}
}
function _spendBurnMintAllowance(address user) private {
uint256 currentAllowance = allowanceBurnMints(user, _msgSender());
if (currentAllowance != type(uint256).max) {
if (currentAllowance == 0) revert TitanX_InsufficientBurnAllowance();
--s_allowanceBurnMints[user][_msgSender()];
}
}
function _calculateUserCycleReward(
address user,
uint256 cycleNo,
PayoutClaim payoutClaim
)
private
view
returns (
uint256 rewards,
uint256 userClaimCycleIndex,
uint256 userClaimSharesIndex,
uint256 userClaimBurnCycleIndex
)
{
uint256 cycleMaxIndex = getCurrentCycleIndex(cycleNo);
if (payoutClaim == PayoutClaim.SHARES) {
(userClaimCycleIndex, userClaimSharesIndex) = getUserLastClaimIndex(user, cycleNo);
uint256 sharesMaxIndex = getUserLatestShareIndex(user);
for (uint256 i = userClaimCycleIndex; i <= cycleMaxIndex; i++) {
(uint256 payoutPerShare, uint256 payoutDay) = getPayoutPerShare(cycleNo, i);
uint256 shares;
for (uint256 j = userClaimSharesIndex; j <= sharesMaxIndex; j++) {
if (getUserActiveSharesDay(user, j) <= payoutDay)
shares = getUserActiveShares(user, j);
else break;
userClaimSharesIndex = j;
}
if (payoutPerShare != 0 && shares != 0) {
rewards += (shares * payoutPerShare) / SCALING_FACTOR_1e18;
}
userClaimCycleIndex = i + 1;
}
} else if (cycleNo == DAY28 && payoutClaim == PayoutClaim.BURN) {
userClaimBurnCycleIndex = getUserLastBurnClaimIndex(user, cycleNo);
for (uint256 i = userClaimBurnCycleIndex; i <= cycleMaxIndex; i++) {
uint256 burnPayoutPerToken = getCycleBurnPayoutPerToken(i);
rewards += (burnPayoutPerToken != 0)
? (burnPayoutPerToken * _getUserCycleBurnTotal(user, i)) / SCALING_FACTOR_1e18
: 0;
userClaimBurnCycleIndex = i + 1;
}
}
}
function getBalance() public view returns (uint256) {
return address(this).balance;
}
function getUndistributedEth() public view returns (uint256) {
return s_undistributedEth;
}
function getUserETHClaimableTotal(address user) public view returns (uint256 reward) {
uint256 _reward;
(_reward, , , ) = _calculateUserCycleReward(user, DAY8, PayoutClaim.SHARES);
reward += _reward;
(_reward, , , ) = _calculateUserCycleReward(user, DAY28, PayoutClaim.SHARES);
reward += _reward;
(_reward, , , ) = _calculateUserCycleReward(user, DAY90, PayoutClaim.SHARES);
reward += _reward;
(_reward, , , ) = _calculateUserCycleReward(user, DAY369, PayoutClaim.SHARES);
reward += _reward;
(_reward, , , ) = _calculateUserCycleReward(user, DAY888, PayoutClaim.SHARES);
reward += _reward;
}
function getUserBurnPoolETHClaimableTotal(address user) public view returns (uint256 reward) {
(reward, , , ) = _calculateUserCycleReward(user, DAY28, PayoutClaim.BURN);
}
function getTotalPenalties() public view returns (uint256) {
return getTotalMintPenalty() + getTotalStakePenalty();
}
function getCycleBurnPool() public view returns (uint256) {
return s_cycleBurnReward;
}
function getCurrentUserBurnCyclePercentage() public view returns (uint256) {
uint256 index = getCurrentCycleIndex(DAY28) + 1;
uint256 cycleBurnTotal = getCycleBurnTotal(index);
return
cycleBurnTotal == 0
? 0
: (_getUserCycleBurnTotal(_msgSender(), index) * 100 * SCALING_FACTOR_1e18) /
cycleBurnTotal;
}
function getUserCycleBurnTotal(address user) public view returns (uint256) {
return _getUserCycleBurnTotal(user, getCurrentCycleIndex(DAY28) + 1);
}
function isBurnPoolEnabled() public view returns (BurnPoolEnabled) {
return s_burnPoolEnabled;
}
function allowanceBurnStakes(address user, address spender) public view returns (uint256) {
return s_allowanceBurnStakes[user][spender];
}
function allowanceBurnMints(address user, address spender) public view returns (uint256) {
return s_allowanceBurnMints[user][spender];
}
function manualDailyUpdate() public dailyUpdate {}
function burnTokensToPayAddress(
address user,
uint256 amount,
uint256 userRebatePercentage,
uint256 rewardPaybackPercentage,
address rewardPaybackAddress
) public dailyUpdate nonReentrant {
_burnLiquidTitan(
user,
amount,
userRebatePercentage,
rewardPaybackPercentage,
rewardPaybackAddress
);
}
function burnTokens(
address user,
uint256 amount,
uint256 userRebatePercentage,
uint256 rewardPaybackPercentage
) public dailyUpdate nonReentrant {
_burnLiquidTitan(user, amount, userRebatePercentage, rewardPaybackPercentage, _msgSender());
}
function userBurnTokens(uint256 amount) public dailyUpdate nonReentrant {
if (amount == 0) revert TitanX_InvalidAmount();
if (balanceOf(_msgSender()) < amount) revert TitanX_InsufficientBalance();
_burn(_msgSender(), amount);
_updateBurnAmount(
_msgSender(),
address(0),
amount,
getCurrentCycleIndex(DAY28) + 1,
BurnSource.LIQUID
);
}
function burnStakeToPayAddress(
address user,
uint256 id,
uint256 userRebatePercentage,
uint256 rewardPaybackPercentage,
address rewardPaybackAddress
) public dailyUpdate nonReentrant {
_burnStake(user, id, userRebatePercentage, rewardPaybackPercentage, rewardPaybackAddress);
}
function burnStake(
address user,
uint256 id,
uint256 userRebatePercentage,
uint256 rewardPaybackPercentage
) public dailyUpdate nonReentrant {
_burnStake(user, id, userRebatePercentage, rewardPaybackPercentage, _msgSender());
}
function userBurnStake(uint256 id) public dailyUpdate nonReentrant {
_updateBurnAmount(
_msgSender(),
address(0),
_endStake(
_msgSender(),
id,
getCurrentContractDay(),
StakeAction.BURN,
StakeAction.END_OWN,
getGlobalPayoutTriggered()
),
getCurrentCycleIndex(DAY28) + 1,
BurnSource.STAKE
);
}
function burnMint(address user, uint256 id) public dailyUpdate nonReentrant {
_burnMint(user, id);
}
function userBurnMint(uint256 id) public dailyUpdate nonReentrant {
_updateBurnAmount(
_msgSender(),
address(0),
_claimMint(_msgSender(), id, MintAction.BURN),
getCurrentCycleIndex(DAY28) + 1,
BurnSource.MINT
);
}
function approveBurnMints(address spender, uint256 amount) public returns (bool) {
if (spender == address(0)) revert TitanX_InvalidAddress();
s_allowanceBurnMints[_msgSender()][spender] = amount;
emit ApproveBurnMints(_msgSender(), spender, amount);
return true;
}
function approveBurnStakes(address spender, uint256 amount) public returns (bool) {
if (spender == address(0)) revert TitanX_InvalidAddress();
s_allowanceBurnStakes[_msgSender()][spender] = amount;
emit ApproveBurnStakes(_msgSender(), spender, amount);
return true;
}
}
文件 15 的 17:calcFunctions.sol
pragma solidity ^0.8.10;
import "./constant.sol";
import "./enum.sol";
function getBatchMintLadderCount(
uint256 minDay,
uint256 maxDay,
uint256 dayInterval,
uint256 countPerInterval
) pure returns (uint256 count) {
if (maxDay > minDay) {
count = (((maxDay - minDay) / dayInterval) + 1) * countPerInterval;
}
}
function getIncentiveFeePercent() pure returns (uint256) {
return (INCENTIVE_FEE_PERCENT * 1e4) / INCENTIVE_FEE_PERCENT_BASE;
}
function getBatchMintCost(
uint256 mintPower,
uint256 count,
uint256 mintCost
) pure returns (uint256) {
return (mintCost * mintPower * count) / MAX_MINT_POWER_CAP;
}
function calculateMintReward(
uint256 mintPower,
uint256 numOfDays,
uint256 mintableTitan,
uint256 EAABonus,
uint256 burnAmpBonus
) pure returns (uint256 reward) {
uint256 baseReward = (mintableTitan * mintPower * numOfDays);
if (numOfDays != 1)
baseReward -= (baseReward * MINT_DAILY_REDUCTION * (numOfDays - 1)) / PERCENT_BPS;
reward = baseReward;
if (EAABonus != 0) {
reward += ((baseReward * EAABonus) / 100 / SCALING_FACTOR_1e6);
}
if (burnAmpBonus != 0) {
reward += (baseReward * burnAmpBonus) / 100 / SCALING_FACTOR_1e18;
}
reward /= MAX_MINT_POWER_CAP;
}
function calculateMintPowerBonus(
uint256 mintPowerBonus,
uint256 mintPower,
uint256 gMintPower,
uint256 globalMintPower
) pure returns (uint256 bonus) {
if (globalMintPower <= gMintPower) return 0;
bonus = (((mintPowerBonus * mintPower * (globalMintPower - gMintPower)) * SCALING_FACTOR_1e18) /
MAX_MINT_POWER_CAP);
}
function getMaxMintDays() pure returns (uint256) {
return MAX_MINT_LENGTH;
}
function getMaxMintsPerWallet() pure returns (uint256) {
return MAX_MINT_PER_WALLET;
}
function calculateClaimMintPenalty(uint256 secsLate) pure returns (uint256 penalty) {
if (secsLate <= CLAIM_MINT_GRACE_PERIOD * SECONDS_IN_DAY) return 0;
if (secsLate <= (CLAIM_MINT_GRACE_PERIOD + 1) * SECONDS_IN_DAY) return 1;
if (secsLate <= (CLAIM_MINT_GRACE_PERIOD + 2) * SECONDS_IN_DAY) return 3;
if (secsLate <= (CLAIM_MINT_GRACE_PERIOD + 3) * SECONDS_IN_DAY) return 8;
if (secsLate <= (CLAIM_MINT_GRACE_PERIOD + 4) * SECONDS_IN_DAY) return 17;
if (secsLate <= (CLAIM_MINT_GRACE_PERIOD + 5) * SECONDS_IN_DAY) return 35;
if (secsLate <= (CLAIM_MINT_GRACE_PERIOD + 6) * SECONDS_IN_DAY) return 72;
return 99;
}
error TitanX_AtLeastHalfMaturity();
function getMaxStakeLength() pure returns (uint256) {
return MAX_STAKE_LENGTH;
}
function calculateShares(
uint256 amount,
uint256 noOfDays,
uint256 shareRate
) pure returns (uint256) {
uint256 shares = amount;
shares += (shares * calculateShareBonus(amount, noOfDays)) / SCALING_FACTOR_1e11;
shares /= (shareRate / SCALING_FACTOR_1e18);
return shares;
}
function calculateShareBonus(uint256 amount, uint256 noOfDays) pure returns (uint256 shareBonus) {
uint256 cappedExtraDays = noOfDays <= LPB_MAX_DAYS ? noOfDays : LPB_MAX_DAYS;
uint256 cappedStakedTitan = amount <= BPB_MAX_TITAN ? amount : BPB_MAX_TITAN;
shareBonus =
((cappedExtraDays * SCALING_FACTOR_1e11) / LPB_PER_PERCENT) +
((cappedStakedTitan * SCALING_FACTOR_1e11) / BPB_PER_PERCENT);
return shareBonus;
}
function calculateEndStakePenalty(
uint256 stakeStartTs,
uint256 maturityTs,
uint256 currentBlockTs,
StakeAction action
) view returns (uint256) {
if (currentBlockTs > maturityTs) {
uint256 lateSec = currentBlockTs - maturityTs;
uint256 gracePeriodSec = END_STAKE_GRACE_PERIOD * SECONDS_IN_DAY;
if (lateSec <= gracePeriodSec) return 0;
return max((min((lateSec - gracePeriodSec), 1) / SECONDS_IN_DAY) + 1, 99);
}
if (action == StakeAction.BURN) return 0;
if (block.timestamp < stakeStartTs + (maturityTs - stakeStartTs) / 2)
revert TitanX_AtLeastHalfMaturity();
return 50;
}
function min(uint256 a, uint256 b) pure returns (uint256) {
if (a > b) return a;
return b;
}
function max(uint256 a, uint256 b) pure returns (uint256) {
if (a > b) return b;
return a;
}
文件 16 的 17:constant.sol
pragma solidity ^0.8.10;
uint256 constant SECONDS_IN_DAY = 86400;
uint256 constant SCALING_FACTOR_1e3 = 1e3;
uint256 constant SCALING_FACTOR_1e6 = 1e6;
uint256 constant SCALING_FACTOR_1e7 = 1e7;
uint256 constant SCALING_FACTOR_1e11 = 1e11;
uint256 constant SCALING_FACTOR_1e18 = 1e18;
uint256 constant PERCENT_TO_BUY_AND_BURN = 62_00;
uint256 constant PERCENT_TO_CYCLE_PAYOUTS = 28_00;
uint256 constant PERCENT_TO_BURN_PAYOUTS = 7_00;
uint256 constant PERCENT_TO_GENESIS = 3_00;
uint256 constant INCENTIVE_FEE_PERCENT = 3300;
uint256 constant INCENTIVE_FEE_PERCENT_BASE = 1_000_000;
uint256 constant INITAL_LP_TOKENS = 100_000_000_000 ether;
uint256 constant START_MAX_MINTABLE_PER_DAY = 8_000_000 ether;
uint256 constant CAPPED_MIN_DAILY_TITAN_MINTABLE = 800 ether;
uint256 constant DAILY_SUPPLY_MINTABLE_REDUCTION = 99_65;
uint256 constant EAA_START = 10 * SCALING_FACTOR_1e6;
uint256 constant EAA_BONUSE_FIXED_REDUCTION_PER_DAY = 28_571;
uint256 constant EAA_END = 0;
uint256 constant MAX_BONUS_DAY = 350;
uint256 constant START_MAX_MINT_COST = 0.2 ether;
uint256 constant CAPPED_MAX_MINT_COST = 1 ether;
uint256 constant DAILY_MINT_COST_INCREASE_STEP = 100_08;
uint256 constant START_MINTPOWER_INCREASE_BONUS = 35 * SCALING_FACTOR_1e7;
uint256 constant CAPPED_MIN_MINTPOWER_BONUS = 35 * SCALING_FACTOR_1e3;
uint256 constant DAILY_MINTPOWER_INCREASE_BONUS_REDUCTION = 99_65;
uint256 constant START_SHARE_RATE = 800 ether;
uint256 constant DAILY_SHARE_RATE_INCREASE_STEP = 100_03;
uint256 constant CAPPED_MAX_RATE = 2_800 ether;
uint256 constant DAY8 = 8;
uint256 constant DAY28 = 28;
uint256 constant DAY90 = 90;
uint256 constant DAY369 = 369;
uint256 constant DAY888 = 888;
uint256 constant CYCLE_8_PERCENT = 28_00;
uint256 constant CYCLE_28_PERCENT = 28_00;
uint256 constant CYCLE_90_PERCENT = 18_00;
uint256 constant CYCLE_369_PERCENT = 18_00;
uint256 constant CYCLE_888_PERCENT = 8_00;
uint256 constant PERCENT_BPS = 100_00;
uint256 constant MAX_MINT_POWER_CAP = 100;
uint256 constant MAX_MINT_LENGTH = 280;
uint256 constant CLAIM_MINT_GRACE_PERIOD = 7;
uint256 constant MAX_BATCH_MINT_COUNT = 100;
uint256 constant MAX_MINT_PER_WALLET = 1000;
uint256 constant MAX_BURN_AMP_BASE = 80 * 1e9 * 1 ether;
uint256 constant MAX_BURN_AMP_PERCENT = 8 ether;
uint256 constant MINT_DAILY_REDUCTION = 11;
uint256 constant MAX_STAKE_PER_WALLET = 1000;
uint256 constant MIN_STAKE_LENGTH = 28;
uint256 constant MAX_STAKE_LENGTH = 3500;
uint256 constant END_STAKE_GRACE_PERIOD = 7;
uint256 constant LPB_MAX_DAYS = 2888;
uint256 constant LPB_PER_PERCENT = 825;
uint256 constant BPB_MAX_TITAN = 100 * 1e9 * SCALING_FACTOR_1e18;
uint256 constant BPB_PER_PERCENT = 1_250_000_000_000 * SCALING_FACTOR_1e18;
uint256 constant MAX_BURN_REWARD_PERCENT = 8;
文件 17 的 17:enum.sol
pragma solidity ^0.8.10;
enum MintAction {
CLAIM,
BURN
}
enum MintStatus {
ACTIVE,
CLAIMED,
BURNED
}
enum StakeAction {
START,
END,
BURN,
END_OWN,
END_OTHER
}
enum StakeStatus {
ACTIVE,
ENDED,
BURNED
}
enum PayoutTriggered {
NO,
YES
}
enum InitialLPMinted {
NO,
YES
}
enum PayoutClaim {
SHARES,
BURN
}
enum BurnSource {
LIQUID,
MINT,
STAKE
}
enum BurnPoolEnabled {
FALSE,
TRUE
}
{
"compilationTarget": {
"contracts/TITANX.sol": "TITANX"
},
"evmVersion": "shanghai",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 20
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"genesisAddress","type":"address"},{"internalType":"address","name":"buyAndBurnAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"TitanX_AtLeastHalfMaturity","type":"error"},{"inputs":[],"name":"TitanX_EmptyUndistributeFees","type":"error"},{"inputs":[],"name":"TitanX_FailedToSendAmount","type":"error"},{"inputs":[],"name":"TitanX_InsufficientBalance","type":"error"},{"inputs":[],"name":"TitanX_InsufficientBurnAllowance","type":"error"},{"inputs":[],"name":"TitanX_InsufficientProtocolFees","type":"error"},{"inputs":[],"name":"TitanX_InvalidAddress","type":"error"},{"inputs":[],"name":"TitanX_InvalidAmount","type":"error"},{"inputs":[],"name":"TitanX_InvalidBatchCount","type":"error"},{"inputs":[],"name":"TitanX_InvalidBurnRewardPercent","type":"error"},{"inputs":[],"name":"TitanX_InvalidMintLadderInterval","type":"error"},{"inputs":[],"name":"TitanX_InvalidMintLadderRange","type":"error"},{"inputs":[],"name":"TitanX_InvalidMintLength","type":"error"},{"inputs":[],"name":"TitanX_InvalidMintPower","type":"error"},{"inputs":[],"name":"TitanX_InvalidStakeLength","type":"error"},{"inputs":[],"name":"TitanX_LPTokensHasMinted","type":"error"},{"inputs":[],"name":"TitanX_MaxedWalletMints","type":"error"},{"inputs":[],"name":"TitanX_MaxedWalletStakes","type":"error"},{"inputs":[],"name":"TitanX_MintHasBurned","type":"error"},{"inputs":[],"name":"TitanX_MintHasClaimed","type":"error"},{"inputs":[],"name":"TitanX_MintNotMature","type":"error"},{"inputs":[],"name":"TitanX_NoCycleRewardToClaim","type":"error"},{"inputs":[],"name":"TitanX_NoMintExists","type":"error"},{"inputs":[],"name":"TitanX_NoSharesExist","type":"error"},{"inputs":[],"name":"TitanX_NoStakeExists","type":"error"},{"inputs":[],"name":"TitanX_NotAllowed","type":"error"},{"inputs":[],"name":"TitanX_NotOnwer","type":"error"},{"inputs":[],"name":"TitanX_NotSupportedContract","type":"error"},{"inputs":[],"name":"TitanX_RequireOneMinimumShare","type":"error"},{"inputs":[],"name":"TitanX_StakeHasBurned","type":"error"},{"inputs":[],"name":"TitanX_StakeHasEnded","type":"error"},{"inputs":[],"name":"TitanX_StakeNotMatured","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"project","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ApproveBurnMints","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"project","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ApproveBurnStakes","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"uint256","name":"cycleNo","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"reward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"burnReward","type":"uint256"}],"name":"CyclePayoutTriggered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ETHDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"day","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"mintCost","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"shareRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintableTitan","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintPowerBonus","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"EAABonus","type":"uint256"}],"name":"GlobalDailyUpdateStats","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"tRank","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardMinted","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"penalty","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintPenalty","type":"uint256"}],"name":"MintClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"tRank","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"gMintpower","type":"uint256"},{"components":[{"internalType":"uint8","name":"mintPower","type":"uint8"},{"internalType":"uint16","name":"numOfDays","type":"uint16"},{"internalType":"uint96","name":"mintableTitan","type":"uint96"},{"internalType":"uint48","name":"mintStartTs","type":"uint48"},{"internalType":"uint48","name":"maturityTs","type":"uint48"},{"internalType":"uint32","name":"mintPowerBonus","type":"uint32"},{"internalType":"uint32","name":"EAABonus","type":"uint32"},{"internalType":"uint128","name":"mintedTitan","type":"uint128"},{"internalType":"uint64","name":"mintCost","type":"uint64"},{"internalType":"enum MintStatus","name":"status","type":"uint8"}],"indexed":false,"internalType":"struct MintInfo.UserMintInfo","name":"userMintInfo","type":"tuple"}],"name":"MintStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"day","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ProtocolFeeRecevied","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"globalStakeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"titanAmount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"penalty","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"penaltyAmount","type":"uint256"}],"name":"StakeEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"globalStakeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numOfDays","type":"uint256"},{"components":[{"internalType":"uint152","name":"titanAmount","type":"uint152"},{"internalType":"uint128","name":"shares","type":"uint128"},{"internalType":"uint16","name":"numOfDays","type":"uint16"},{"internalType":"uint48","name":"stakeStartTs","type":"uint48"},{"internalType":"uint48","name":"maturityTs","type":"uint48"},{"internalType":"enum StakeStatus","name":"status","type":"uint8"}],"indexed":true,"internalType":"struct StakeInfo.UserStakeInfo","name":"userStakeInfo","type":"tuple"}],"name":"StakeStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"project","type":"address"},{"indexed":true,"internalType":"uint256","name":"burnPoolCycleIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"enum BurnSource","name":"titanSource","type":"uint8"}],"name":"TitanBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowanceBurnMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowanceBurnStakes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approveBurnMints","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approveBurnStakes","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"batchClaimMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintPower","type":"uint256"},{"internalType":"uint256","name":"numOfDays","type":"uint256"},{"internalType":"uint256","name":"count","type":"uint256"}],"name":"batchMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintPower","type":"uint256"},{"internalType":"uint256","name":"minDay","type":"uint256"},{"internalType":"uint256","name":"maxDay","type":"uint256"},{"internalType":"uint256","name":"dayInterval","type":"uint256"},{"internalType":"uint256","name":"countPerInterval","type":"uint256"}],"name":"batchMintLadder","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"burnLPTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"burnMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"userRebatePercentage","type":"uint256"},{"internalType":"uint256","name":"rewardPaybackPercentage","type":"uint256"}],"name":"burnStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"userRebatePercentage","type":"uint256"},{"internalType":"uint256","name":"rewardPaybackPercentage","type":"uint256"},{"internalType":"address","name":"rewardPaybackAddress","type":"address"}],"name":"burnStakeToPayAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"userRebatePercentage","type":"uint256"},{"internalType":"uint256","name":"rewardPaybackPercentage","type":"uint256"}],"name":"burnTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"userRebatePercentage","type":"uint256"},{"internalType":"uint256","name":"rewardPaybackPercentage","type":"uint256"},{"internalType":"address","name":"rewardPaybackAddress","type":"address"}],"name":"burnTokensToPayAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"claimMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimUserAvailableETHBurnPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimUserAvailableETHPayouts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"distributeETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableBurnPoolReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"endStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"endStakeForOthers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"genesisTs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentBlockTimeStamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentContractDay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"cycleNo","type":"uint256"}],"name":"getCurrentCycleIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentEAABonus","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentMintCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentMintPowerBonus","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentMintableTitan","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentShareRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentUserBurnCyclePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"cycleIndex","type":"uint256"}],"name":"getCycleBurnPayoutPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCycleBurnPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"cycleIndex","type":"uint256"}],"name":"getCycleBurnTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"cycleNo","type":"uint256"}],"name":"getCyclePayoutPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGlobalActiveShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGlobalActiveStakes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGlobalExpiredShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGlobalMintPower","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGlobalPayoutTriggered","outputs":[{"internalType":"enum PayoutTriggered","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGlobalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGlobalStakeId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGlobalTRank","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"cycleNo","type":"uint256"}],"name":"getNextCyclePayoutDay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"cycleNo","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getPayoutPerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"getProjectBurnTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"address","name":"user","type":"address"}],"name":"getProjectUserBurnTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalActiveMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalBurnTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalMintBurn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalMintClaim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalMintPenalty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalMinting","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalPenalties","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalStakeBurn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalStakeEnd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalStakePenalty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalTitanStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUndistributedEth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserBurnAmplifierBonus","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserBurnPoolETHClaimableTotal","outputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserBurnTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserCurrentActiveShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserCycleBurnTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserETHClaimableTotal","outputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"cycleNo","type":"uint256"}],"name":"getUserLastBurnClaimIndex","outputs":[{"internalType":"uint256","name":"burnCycleIndex","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"cycleNo","type":"uint256"}],"name":"getUserLastClaimIndex","outputs":[{"internalType":"uint256","name":"cycleIndex","type":"uint256"},{"internalType":"uint256","name":"sharesIndex","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserLatestMintId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserLatestShareIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getUserMintInfo","outputs":[{"components":[{"internalType":"uint8","name":"mintPower","type":"uint8"},{"internalType":"uint16","name":"numOfDays","type":"uint16"},{"internalType":"uint96","name":"mintableTitan","type":"uint96"},{"internalType":"uint48","name":"mintStartTs","type":"uint48"},{"internalType":"uint48","name":"maturityTs","type":"uint48"},{"internalType":"uint32","name":"mintPowerBonus","type":"uint32"},{"internalType":"uint32","name":"EAABonus","type":"uint32"},{"internalType":"uint128","name":"mintedTitan","type":"uint128"},{"internalType":"uint64","name":"mintCost","type":"uint64"},{"internalType":"enum MintStatus","name":"status","type":"uint8"}],"internalType":"struct MintInfo.UserMintInfo","name":"mintInfo","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserMints","outputs":[{"components":[{"internalType":"uint256","name":"mId","type":"uint256"},{"internalType":"uint256","name":"tRank","type":"uint256"},{"internalType":"uint256","name":"gMintPower","type":"uint256"},{"components":[{"internalType":"uint8","name":"mintPower","type":"uint8"},{"internalType":"uint16","name":"numOfDays","type":"uint16"},{"internalType":"uint96","name":"mintableTitan","type":"uint96"},{"internalType":"uint48","name":"mintStartTs","type":"uint48"},{"internalType":"uint48","name":"maturityTs","type":"uint48"},{"internalType":"uint32","name":"mintPowerBonus","type":"uint32"},{"internalType":"uint32","name":"EAABonus","type":"uint32"},{"internalType":"uint128","name":"mintedTitan","type":"uint128"},{"internalType":"uint64","name":"mintCost","type":"uint64"},{"internalType":"enum MintStatus","name":"status","type":"uint8"}],"internalType":"struct MintInfo.UserMintInfo","name":"mintInfo","type":"tuple"}],"internalType":"struct MintInfo.UserMint[]","name":"mintInfos","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getUserStakeInfo","outputs":[{"components":[{"internalType":"uint152","name":"titanAmount","type":"uint152"},{"internalType":"uint128","name":"shares","type":"uint128"},{"internalType":"uint16","name":"numOfDays","type":"uint16"},{"internalType":"uint48","name":"stakeStartTs","type":"uint48"},{"internalType":"uint48","name":"maturityTs","type":"uint48"},{"internalType":"enum StakeStatus","name":"status","type":"uint8"}],"internalType":"struct StakeInfo.UserStakeInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserStakes","outputs":[{"components":[{"internalType":"uint256","name":"sId","type":"uint256"},{"internalType":"uint256","name":"globalStakeId","type":"uint256"},{"components":[{"internalType":"uint152","name":"titanAmount","type":"uint152"},{"internalType":"uint128","name":"shares","type":"uint128"},{"internalType":"uint16","name":"numOfDays","type":"uint16"},{"internalType":"uint48","name":"stakeStartTs","type":"uint48"},{"internalType":"uint48","name":"maturityTs","type":"uint48"},{"internalType":"enum StakeStatus","name":"status","type":"uint8"}],"internalType":"struct StakeInfo.UserStakeInfo","name":"stakeInfo","type":"tuple"}],"internalType":"struct StakeInfo.UserStake[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isBurnPoolEnabled","outputs":[{"internalType":"enum BurnPoolEnabled","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manualDailyUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintLPTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"setBuyAndBurnContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"setNewGenesisAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintPower","type":"uint256"},{"internalType":"uint256","name":"numOfDays","type":"uint256"}],"name":"startMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"numOfDays","type":"uint256"}],"name":"startStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"triggerPayouts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"userBurnMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"userBurnStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"userBurnTokens","outputs":[],"stateMutability":"nonpayable","type":"function"}]