Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: low
Valid

Function "createEstateNFT" overwrites "assetToPay" in each call

Summary

Function InheritanceManager::createEstateNFT does mot work correctly when several NFTs are created.

Vulnerability Details

Function InheritanceManager::createEstateNFT creates a new NFT and stores its value in nftValue mapping. Also, it stores assetToPay related to the NFT. The issue here is that if a new NFT is created with another asset, the assetToPay is overwritten and becomes not valid for the previous NFTs.

Impact

If there are several NFTs and they were created with different assets, the beneficiaries will pay for some of the NFTs incorrect assets.

Tools Used

Manual review

Recommendations

Use mapping for assets to pay:

InheritanceManager.sol:

-assetToPay = _asset;
+assetToPay[nftID] = _asset;

Trustee.sol:

-address assetToPay;
+mapping(uint256 NftIndex => address addr) assetToPay;
Updates

Lead Judging Commences

0xtimefliez Lead Judge 9 months ago
Submission Judgement Published
Validated
Assigned finding tags:

global asset in NFT values

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!