The smart contract Asset.sol has a potential security vulnerability in its constructor function. The constructor does not validate if the diamondAddr parameter is a zero address, which could lead to unintended behavior and potential security risks.
The constructor of the Asset contract takes diamondAddr as a parameter and assigns it to the diamond state variable. However, there is no check to ensure that diamondAddr is not a zero address.
The impact of this issue could be significant. If the diamond address is mistakenly set to the zero address, it would mean that no address could call the functions protected by the onlyDiamond modifier. This could effectively lock the contract, preventing the minting and burning of tokens.
Tools Used
The vulnerability was identified using manual code review techniques.
It is recommended to add a check in the constructor to ensure that diamondAddr is not a zero address. This can be done using the require function to validate the input.
This code will revert the transaction if diamondAddr is the zero address, preventing the diamond
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.