Skip to content

Code4rena

TraitForge

Every publicly disclosed report for TraitForge and what kind of bugs they were.

disclosed reports
25
most reported class
Business logic
bug classes found
4
first disclosure
2024
Find TraitForge on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what TraitForge chose to make public.

Business logic

Griefing attack on seller’s airdrop benefits

The airdrop allocation for a token is credited to the original minter and is not transferred when the token is sold. If the new owner burns or nukes the token, the original minter's airdrop amount is reduced, causing a loss to the seller.

TraitForge

High
Business logic

Forger Entities can forge more times than intended

The forging count for a forger entity is checked before it is incremented, so an entity can list for forging one more time than its forge potential allows. An attacker could forge more times than intended, exceeding the limit set by the protocol.

TraitForge

Medium
Business logic

Wrong minting logic based on total token count across generations

The mintWithBudget function incorrectly uses the total token count across all generations to limit minting, instead of the count for the current generation. This prevents users from minting multiple tokens in later generations once the total exceeds the per-generation limit.

TraitForge

High
Business logic

The maximum number of generations is infinite

The smart contract lacked a check to enforce a maximum generation limit, allowing users to mint NFTs beyond the intended cap of 10 generations. An attacker could mint an unlimited number of NFTs, exceeding the maximum supply.

TraitForge

High
Access control

Pause and unpause functions are inaccessible

The contracts inherit OpenZeppelin's Pausable but never expose the internal pause and unpause functions, so administrators cannot pause or resume operations. This leaves the emergency stop feature unusable, potentially preventing timely intervention during incidents.

TraitForge

Medium
Business logic

NFTs mature too slowly under default settings.

The default nuke factor increase is set too low, causing NFTs to mature far slower than intended. An attacker could exploit this by holding NFTs for an extremely long time to eventually claim a larger share of the Nuke Fund, though the practical impact is limited.

TraitForge

Medium
Business logic

Duplicate NFT generation via repeated forging with the same parent

The forging function allows the same parent NFT to be used multiple times, producing new NFTs with identical generation and entropy. An attacker could repeatedly forge with the same parent to obtain duplicate NFTs.

TraitForge

Medium
Access control

Incorrect isApprovedForAll check in the NukeFund.nuke() function

The NukeFund.nuke function incorrectly checks whether the caller (msg.sender) has approved the contract for all tokens, rather than checking the token owner's approval. This prevents approved users from nuking tokens they are authorised to burn.

TraitForge

Medium
Business logic

Excess ETH from forgingFee can get stuck in EntityForging under certain situations

The forgeWithListed function accepts more ETH than the required forging fee but only distributes the exact fee, leaving excess ETH permanently locked in the contract. An attacker could exploit this if the fee is reduced between transaction submission and execution, causing the overpayment to become stuck.

TraitForge

Medium
Business logic

Each generation should have 1 “Golden God” NFT, but there could be 0

The location of the rare 'Golden God' NFT is chosen pseudo-randomly, but the selection can place it in the last 10 entropy slots of a generation, which are never minted because minting stops at 10,000 NFTs. As a result, a generation could have zero Golden God NFTs, contrary to the intended design.

TraitForge

Medium
Business logic

A dev will lose rewards if after claiming his rewards he mints an NFT

A developer who claims rewards from DevFund and immediately mints an NFT with those funds can lose part of their rewards because the contract updates the developer's reward debt after the external call, so the new minting fees increase the debt before the developer's claim is settled.

TraitForge

Medium
Business logic

Funds can be locked indefinitely in NukeFund.sol

The NukeFund contract only allows funds to be withdrawn when an NFT holder calls the nuke function, which burns their NFT. If all NFTs are burned or holders never call nuke, the remaining funds become permanently locked in the contract.

TraitForge

Medium
Business logic

Number of entities in generation can surpass the 10k number

The generation increment function resets the per-generation mint counter to zero, so entities forged into the next generation before the first mint of that generation are not counted. An attacker could therefore push a generation past its intended 10,000 entity cap, breaking the protocol's core invariant.

TraitForge

High
Business logic

Lack of slippage protection in dynamic pricing mint function

The mint function recalculates the price of each NFT inside the minting loop, so the price can rise between the user's estimate and their transaction being processed. A user could therefore receive fewer NFTs than expected for the same budget, or pay more per NFT than anticipated.

TraitForge

Medium
Smart contracts

Incorrect check against golden entropy value in the first two batches

The entropy generation functions for the first two batches check the whole 256-bit slot value against the golden entropy number instead of checking each of the 13 packed entropy values inside it. As a result, a golden entropy can slip into the first two passes, contrary to the documented rule that it should only appear in the final pass.

TraitForge

Medium
Business logic

Discrepancy between nfts minted, price of nft when a generation changes & position of _incrementGeneration() inside _mintInternal() and _mintNewEntity()

The minting price calculation and generation increment logic are misaligned, causing users to pay the maximum price of the previous generation when minting the first NFT of a new generation, or to pay the starting price when they should pay more. This results in financial loss for either the user or the protocol.

TraitForge

Medium
Business logic

Golden God tokens can be minted twice per generation

The entropy generator could produce two Golden God tokens (entropy 999999) in a single generation, because one is hard-coded at a fixed slot and number position while another can arise from the batch-written entropy data. This undermines the intended uniqueness and rarity of the token, affecting game fairness and economy.

TraitForge

Medium
Business logic

There is no slippage check in the nuke() function

The nuke() function lacks a minimum claim amount check, so a user's payout can be reduced if another user's nuke transaction is processed first. An attacker could front-run or benefit from transaction ordering to receive a larger share, leaving the victim with less than expected.

TraitForge

Medium