Transfer Logic with Fees and Cycles
The `_transfer` function applies fees, checks cycles, and processes rewards:
// ```solidity
function _transfer(address _from, address _to, uint256 _value) internal returns (bool) {
// ... require checks ...
// Cycle check and adjust supply
if (block.timestamp > last_turnTime + 60) {
if (_totalSupply >= max_supply) {
isBurning = true;
_turn();
// Burn excess
} else if (_totalSupply <= min_supply) {
isBurning = false;
_turn();
// Mint to pool
}
}
// Apply fees based on burning state
if (isBurning) {
uint256 burn_amt = _pctCalc_minusScale(_value, burn_pct);
// ... burn, treasury, rewards pool transfers ...
} else {
uint256 mint_amt = _pctCalc_minusScale(_value, mint_pct);
// ... mint, treasury, rewards pool transfers ...
}
// Update last TX times and process eligibility
lastTXtime[tx.origin] = block.timestamp;
lastTXtime[_from] = block.timestamp;
lastTXtime[_to] = block.timestamp;
rewardProcess(_value, tx.origin, _from, _to); // Accumulate rewards eligibility
return true;
}
```
Last updated