The createEstateNFT()
function allows setting assetToPay
to any address including address(0)
(the zero address), but the buyOutEstateNFT()
function explicitly does not support ETH payments and will fail if assetToPay
is set to address(0)
.
In buyOutEstateNFT()
, the function attempts to use the ERC20 interface on whatever address is stored in assetToPay
:
If the owner sets assetToPay
to address(0)
, the buyOutEstateNFT()
function will always revert because address(0)
does not implement the ERC20 interface.
This would permanently lock the NFT, making it impossible for beneficiaries to buy out the estate, directly contradicting the intended inheritance functionality.
The inconsistency between allowing address(0)
in createEstateNFT()
but not supporting it in buyOutEstateNFT()
creates a potential denial of service vulnerability.
Add validation in the createEstateNFT()
function to prevent setting assetToPay
to address(0)
:
Alternatively, if ETH payments should be supported, modify the buyOutEstateNFT()
function to handle both ERC20 tokens and ETH payments using a pattern similar to the one used in withdrawInheritedFunds()
.
Manual Code Review
Static Analysis
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.