abstract contract MaxWalletDynamic {
    uint256 startMaxWallet;
    uint256 startTime; // last increment time
    uint256 constant startMaxBuyPercentil = 5; // maximum buy on start 1000=100%
    uint256 constant maxBuyIncrementMinutesTimer = 2; // increment maxbuy minutes
    uint256 constant maxBuyIncrementPercentil = 3; // increment maxbyu percentil 1000=100%
    uint256 constant maxIncrements = 1000; // maximum time incrementations
    uint256 maxBuyIncrementValue; // value for increment maxBuy

    function startMaxWalletDynamic(uint256 totalSupply) internal {
        startTime = block.timestamp;
        startMaxWallet = (totalSupply * startMaxBuyPercentil) / 1000;
        maxBuyIncrementValue = (totalSupply * maxBuyIncrementPercentil) / 1000;
    }

    function checkMaxWallet(uint256 walletSize) internal view {
        require(walletSize <= getMaxWallet(), "max wallet limit");
    }

    function getMaxWallet() public view returns (uint256) {
        uint256 incrementCount = (block.timestamp - startTime) /
            (maxBuyIncrementMinutesTimer * 1 minutes);
        if (incrementCount >= maxIncrements) incrementCount = maxIncrements;
        return startMaxWallet + maxBuyIncrementValue * incrementCount;
    }

    function _setStartMaxWallet(uint256 startMaxWallet_) internal {
        startMaxWallet = startMaxWallet_;
    }
}
function startMaxWalletDynamic(uint256 totalSupply) internal {
    startTime = block.timestamp;
    startMaxWallet = (totalSupply * startMaxBuyPercentil) / 1000;
    maxBuyIncrementValue = (totalSupply * maxBuyIncrementPercentil) / 1000;
}

// value for increment maxBuy