The MysteryBox::changeOwner function does not check if the new owner address is the zero address. This means the contract would have no owner and key functions would not be able to be executed again.
As can be seen below there is no check on the value of the _newOwner, this means the value that is passed to the function could be the zero address, which no one controls.
The following functions will no longer be able to be called:
MysteryBox::addReward
MyseryBox::withdraw
MysteryBox::setBoxPrice
MyseryBox::changeOwner
As a result, the core functionality of the game will be frozen, as no new rewards can be added and the price of the mystery boxes will permanently remain the same. Additionally, only the players will be able to earn ether from the contract as no one is able to call MysteryBox::withdraw.
Manual review & Aderyn
Add a check that the address is not the zero address, as seen below:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.