contract NitroProtocol {
    /// Struct for timelocked bonus tokens
    struct TimelockedBonus {
        uint256 bonusAmount;
        uint releaseBlock;
    }

    /// @notice Mapping of owed bonus tokens from buy orders. Includes bonus amounts and releaseTimestamps
    mapping (address => TimelockedBonus) private _timelockedBonuses;
    
    /// @notice max sell percentage allowed. If pre-calculated nitro is greater than this, it becomes equal
    uint256 private _maxSellRemoval; //units are %

    /// @notice max percentage bonus tokens per buy order. If pre-calculated nitro is greater than this, it becomes equal
    uint256 private _maxBuyBonus; //units are %

//////////////////----------------Public View Variables----------------///////////////

    //Return the maxSellRemoval
    function maxSellRemoval() public view returns (uint256) {
        return _maxSellRemoval;
    }

    function maxBuyBonus() public view returns (uint256) {
        return _maxBuyBonus;
    }

    /**
     * Return the block unlock time for a given mapping.
     */
    function getBonusUnlockTime(address bonusAddress) public view returns (uint) {
        return _timelockedBonuses[bonusAddress].releaseBlock; //Using memory, temporary
    }

    /**
     * Get the available bonus for this address (once it is unlocked)
     */
    function getBonusAmount(address bonusAddress) public view returns (uint256) {
        return _timelockedBonuses[bonusAddress].bonusAmount;
    }

//////////////////----------------Modify Variables, Internal----------------///////////////

    /**
     * @dev Set the maximum percent order volume of tokens taken in a sell order
     */
    function _changeMaxSellRemoval(uint256 new_maxSellRemoval) internal {
        _maxSellRemoval = new_maxSellRemoval;
    }

    /**
     * @dev Set the maximum percent order volume of bonus tokens for buyers
     */
    function _setMaxBuyBonusPercentage(uint256 new_maxBuyBonus) internal {
        _maxBuyBonus = new_maxBuyBonus;
    }

//////////////////----------------Timelocked Bonuses Interface----------------///////////////

    /**
     * Add/create a TimelockedBonus struct to the _timelockedBonuses mapping
     */
    function _addToTimelockedBonus(address bonusAddress, uint256 tokens_to_add, uint releaseBlockNumber) internal {
        _timelockedBonuses[bonusAddress] = TimelockedBonus((_timelockedBonuses[bonusAddress].bonusAmount + tokens_to_add), releaseBlockNumber);
    }

    /**
     * Sets the timelocked Bonus for a given address to be exactly 0 
     */
    function _removeTimelockedBonus(address bonusAddress) internal {
        uint256 amount = 0;
        _timelockedBonuses[bonusAddress] = TimelockedBonus(amount, block.number);
    }
}
function _removeTimelockedBonus(address bonusAddress) internal {
    uint256 amount = 0;
    _timelockedBonuses[bonusAddress] = TimelockedBonus(amount, block.number);
}

/**
 * Sets the timelocked Bonus for a given address to be exactly 0
 */