abstract contract FastSellLimit {
    mapping(address => uint256) public canSellTimes; // when accounts can sell tokens

    function updateCanSellTime(
        address account,
        uint256 balance,
        uint256 onePercent
    ) internal {
        canSellTimes[account] =
            block.timestamp +
            getTimeInterval(balance, onePercent);
    }

    function checkCanSellTime(address account) internal view {
        require(block.timestamp >= canSellTimes[account], "fast sell limit");
    }

    function getTimeInterval(uint256 balance, uint256 onePercent)
        private
        pure
        returns (uint256)
    {
        if (balance >= onePercent) return 24 hours; // if more 1% of total then 24 hours
        return (24 hours * balance) / onePercent;
    }

    function getLapsedCanSellTime(address account)
        external
        view
        returns (uint256)
    {
        uint256 canSellTime = canSellTimes[account];
        if (block.timestamp >= canSellTime) return 0;
        return canSellTime - block.timestamp;
    }
}
function updateCanSellTime(
    address account,
    uint256 balance,
    uint256 onePercent
) internal {
    canSellTimes[account] =
        block.timestamp +
        getTimeInterval(balance, onePercent);
}

// when accounts can sell tokens