Submitted by Sabit, also found by 0xDemon, KupiaSec, and dimulski
https://github.com/code-423n4/2024-07-traitforge/blob/279b2887e3d38bc219a05d332cbcb0655b2dc644/contracts/NukeFund/NukeFund.sol#L40-L61
The NukeFund contract has a unique fund distribution model where the primary - and only - method to withdraw funds is through the nuke() function. This design creates a specific set of circumstances under which funds can be extracted from the contract.
Practical example: Lets say the contract has accumulated 100 ETH in its fund. A user holding a qualified NFT (lets call it TokenID 42) wants to claim a portion of this fund.
https://github.com/code-423n4/2024-07-traitforge/blob/279b2887e3d38bc219a05d332cbcb0655b2dc644/contracts/NukeFund/NukeFund.sol#L153-L183
In this scenario:
This process works as intended, but it relies entirely on NFT holders initiating the withdrawal process. Theres no other mechanism for fund distribution or withdrawal, which leads to the second point.
If all NFTs are burned or if no one calls the nuke() function, theres a real risk that funds could remain permanently locked in the contract.
Practical example: Imagine a scenario where the contract has accumulated 500 ETH over time. There are only 10 NFTs left that are eligible for nuking.
Scenario A: All NFTs are burned:
OR
https://github.com/code-423n4/2024-07-traitforge/blob/279b2887e3d38bc219a05d332cbcb0655b2dc644/contracts/TraitForgeNft/TraitForgeNft.sol#L141-L151
Scenario B: Inactivity:
Add a function that allows the contract owner to withdraw funds in case of emergencies or when all NFTs are burned.
Context
Koolex (judge) decreased severity to Medium
