Skip to main content
PulseScanner.io

Address

0xc0c19b2026cb3f648347beb00728174204cd6d33
Current Holdings
$0.00
TXs sent
not counted
First Active
2026-02-09
block 25,746,075
Last Active
218 days ago
block 25,754,576
Funded By
not identified

Net worth historyi

No net-worth snapshots recorded yet
exact matchPulseDecayTokensolc 0.8.33+commit.64118f21runtime exact · creation exact
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

// ===== PULSECHAIN DECAY TOKEN =====
contract PulseDecayToken {
    string public name;
    string public symbol;
    uint8 public decimals;
    uint256 public totalSupply;
    
    // PulseChain specific
    address public constant PULSE_BRIDGE = 0xf1DFc63e10fF01b8c3d307529b47AefaD2154C0e;
    
    // Decreasing limit system
    struct LimitData {
        uint256 currentLimit;
        uint256 decayRate;
        uint256 lastTxTime;
        uint256 baseLimit;
        uint256 resetInterval;
        uint256 totalTxCount;
        uint256 totalDecayed;
    }
    
    LimitData public limitData;
    
    // Mappings
    mapping(address => uint256) private _balances;
    mapping(address => mapping(address => uint256)) private _allowances;
    mapping(address => bool) public isExcludedFromLimits;
    mapping(address => uint256) public userLastTxTime;
    mapping(address => uint256) public userTxCount;
    
    // Events
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
    event LimitUpdated(uint256 newLimit, uint256 decayApplied, uint256 txCount);
    event PulseSwap(address indexed user, uint256 amount, uint256 newLimit, uint256 timestamp);
    event PulseMint(address indexed to, uint256 amount, uint256 newLimit);
    event PulseLimitReset(uint256 newLimit, uint256 timeUntilNextReset);
    event PulseFeeDistributed(address[] recipients, uint256[] amounts);
    
    // Constants
    uint256 public constant MAX_DECAY_RATE = 500;
    uint256 public constant MIN_LIMIT = 100;
    uint256 public constant FEE_PERCENTAGE = 297;
    
    address public owner;
    
    // Fee recipients
    address[] public feeRecipients;
    uint256[] public feeShares;
    
    modifier onlyOwner() {
        require(msg.sender == owner, "Only owner");
        _;
    }
    
    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals,
        uint256 _initialSupply,
        uint256 _initialLimit,
        uint256 _decayRate,
        uint256 _resetInterval
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;
        totalSupply = _initialSupply * 10 ** _decimals;
        _balances[msg.sender] = totalSupply;
        
        owner = msg.sender;
        
        // Initialize limit data
        limitData.currentLimit = _initialLimit * 10 ** _decimals;
        limitData.decayRate = _decayRate;
        limitData.baseLimit = _initialLimit * 10 ** _decimals;
        limitData.resetInterval = _resetInterval;
        limitData.lastTxTime = block.timestamp;
        limitData.totalTxCount = 0;
        limitData.totalDecayed = 0;
        
        // Exclusions
        isExcludedFromLimits[msg.sender] = true;
        isExcludedFromLimits[address(this)] = true;
        isExcludedFromLimits[PULSE_BRIDGE] = true;
        
        // Default fee recipients
        feeRecipients = [msg.sender];
        feeShares = [10000];
        
        emit Transfer(address(0), msg.sender, totalSupply);
        emit LimitUpdated(limitData.currentLimit, 0, 0);
    }
    
    // ERC20 Functions
    function balanceOf(address account) public view returns (uint256) {
        return _balances[account];
    }
    
    function transfer(address to, uint256 amount) public returns (bool) {
        _pulseTransfer(msg.sender, to, amount);
        return true;
    }
    
    function transferFrom(address from, address to, uint256 amount) public returns (bool) {
        address spender = msg.sender;
        _spendAllowance(from, spender, amount);
        _pulseTransfer(from, to, amount);
        return true;
    }
    
    function approve(address spender, uint256 amount) public returns (bool) {
        _approve(msg.sender, spender, amount);
        return true;
    }
    
    function allowance(address owner, address spender) public view returns (uint256) {
        return _allowances[owner][spender];
    }
    
    // Core transfer with decay
    function _pulseTransfer(address from, address to, uint256 amount) internal {
        require(from != address(0), "Transfer from zero");
        require(to != address(0), "Transfer to zero");
        require(_balances[from] >= amount, "Insufficient balance");
        
        uint256 amountAfterFee = amount;
        
        // Apply fee if not excluded
        if (!isExcludedFromLimits[from] && !isExcludedFromLimits[to] && feeRecipients.length > 0) {
            uint256 fee = (amount * FEE_PERCENTAGE) / 10000;
            if (fee > 0) {
                amountAfterFee = amount - fee;
                _distributeFee(fee);
            }
        }
        
        // Check limits
        if (!isExcludedFromLimits[from] && !isExcludedFromLimits[to]) {
            _checkAndUpdateLimits(from, amountAfterFee);
        }
        
        // Update balances
        _balances[from] -= amount;
        _balances[to] += amountAfterFee;
        
        // Update user stats
        userLastTxTime[from] = block.timestamp;
        userLastTxTime[to] = block.timestamp;
        userTxCount[from]++;
        userTxCount[to]++;
        
        emit Transfer(from, to, amountAfterFee);
        
        // Detect swaps
        if (_isSwap(from)) {
            emit PulseSwap(from, amountAfterFee, limitData.currentLimit, block.timestamp);
        }
    }
    
    // Limit management
    function _checkAndUpdateLimits(address user, uint256 amount) internal {
        // Auto-reset
        if (block.timestamp > limitData.lastTxTime + limitData.resetInterval) {
            _resetLimit();
        }
        
        require(amount <= limitData.currentLimit, "Amount exceeds current limit");
        
        // Apply decay
        uint256 decayAmount = (limitData.currentLimit * limitData.decayRate) / 10000;
        uint256 newLimit = limitData.currentLimit - decayAmount;
        
        // Minimum limit
        if (newLimit < (MIN_LIMIT * 10 ** decimals)) {
            newLimit = MIN_LIMIT * 10 ** decimals;
        }
        
        // Update
        limitData.currentLimit = newLimit;
        limitData.lastTxTime = block.timestamp;
        limitData.totalTxCount++;
        limitData.totalDecayed += decayAmount;
        
        emit LimitUpdated(newLimit, decayAmount, limitData.totalTxCount);
    }
    
    // Mint function
    function pulseMint(address to, uint256 amount) public onlyOwner {
        require(to != address(0), "Mint to zero");
        
        if (!isExcludedFromLimits[to]) {
            _checkAndUpdateLimits(to, amount);
        }
        
        totalSupply += amount;
        _balances[to] += amount;
        
        emit Transfer(address(0), to, amount);
        emit PulseMint(to, amount, limitData.currentLimit);
    }
    
    // Fee distribution
    function _distributeFee(uint256 fee) internal {
        uint256 totalShares = 0;
        for (uint256 i = 0; i < feeShares.length; i++) {
            totalShares += feeShares[i];
        }
        
        uint256[] memory distributed = new uint256[](feeRecipients.length);
        
        for (uint256 i = 0; i < feeRecipients.length; i++) {
            uint256 share = (fee * feeShares[i]) / totalShares;
            if (share > 0) {
                _balances[feeRecipients[i]] += share;
                distributed[i] = share;
            }
        }
        
        emit PulseFeeDistributed(feeRecipients, distributed);
    }
    
    // Management functions
    function _resetLimit() internal {
        limitData.currentLimit = limitData.baseLimit;
        limitData.lastTxTime = block.timestamp;
        
        emit PulseLimitReset(limitData.currentLimit, limitData.resetInterval);
    }
    
    function forceReset() public onlyOwner {
        _resetLimit();
    }
    
    function setDecayRate(uint256 newDecayRate) public onlyOwner {
        require(newDecayRate <= MAX_DECAY_RATE, "Decay rate too high");
        limitData.decayRate = newDecayRate;
    }
    
    function setFeeRecipients(address[] memory recipients, uint256[] memory shares) public onlyOwner {
        require(recipients.length == shares.length, "Arrays length mismatch");
        require(recipients.length > 0, "No recipients");
        
        uint256 totalShares = 0;
        for (uint256 i = 0; i < shares.length; i++) {
            totalShares += shares[i];
        }
        require(totalShares == 10000, "Shares must sum to 10000");
        
        feeRecipients = recipients;
        feeShares = shares;
    }
    
    function excludeFromLimits(address account, bool excluded) public onlyOwner {
        isExcludedFromLimits[account] = excluded;
    }
    
    // View functions
    function getCurrentLimit() public view returns (uint256) {
        return limitData.currentLimit;
    }
    
    function getTimeUntilReset() public view returns (uint256) {
        if (block.timestamp > limitData.lastTxTime + limitData.resetInterval) {
            return 0;
        }
        return (limitData.lastTxTime + limitData.resetInterval) - block.timestamp;
    }
    
    function getNextLimit() public view returns (uint256) {
        uint256 decayAmount = (limitData.currentLimit * limitData.decayRate) / 10000;
        uint256 nextLimit = limitData.currentLimit - decayAmount;
        return nextLimit < (MIN_LIMIT * 10 ** decimals) ? (MIN_LIMIT * 10 ** decimals) : nextLimit;
    }
    
    function getUserStats(address user) public view returns (
        uint256 lastTxTime,
        uint256 txCount,
        bool excluded
    ) {
        return (
            userLastTxTime[user],
            userTxCount[user],
            isExcludedFromLimits[user]
        );
    }
    
    // Internal functions
    function _approve(address owner, address spender, uint256 amount) internal {
        require(owner != address(0), "Approve from zero");
        require(spender != address(0), "Approve to zero");
        
        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }
    
    function _spendAllowance(address owner, address spender, uint256 amount) internal {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "Insufficient allowance");
            _approve(owner, spender, currentAllowance - amount);
        }
    }
    
    function _isSwap(address user) internal pure returns (bool) {
        // Simplified swap detection
        return user != address(0);
    }
}

// ===== PULSECHAIN FACTORY (SIMPLIFIED) =====
contract PulseDecayFactory {
    address[] public deployedTokens;
    
    event TokenDeployed(
        address indexed token,
        string name,
        string symbol,
        address indexed owner,
        uint256 timestamp
    );
    
    function createToken(
        string memory name,
        string memory symbol,
        uint8 decimals,
        uint256 initialSupply,
        uint256 initialLimit,
        uint256 decayRate,
        uint256 resetInterval
    ) public returns (address) {
        PulseDecayToken newToken = new PulseDecayToken(
            name,
            symbol,
            decimals,
            initialSupply,
            initialLimit,
            decayRate,
            resetInterval
        );
        
        deployedTokens.push(address(newToken));
        
        emit TokenDeployed(address(newToken), name, symbol, msg.sender, block.timestamp);
        
        return address(newToken);
    }
    
    function getDeployedTokens() public view returns (address[] memory) {
        return deployedTokens;
    }
}