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

Global `assetToPay` Overwrite in NFT Creation

Summary

The assetToPay variable is globally shared across all NFTs, causing later NFTs to overwrite previous payment token settings.

Vulnerability Details

In createEstateNFT, assetToPay is updated for every NFT creation. This means only the last NFT’s payment token is retained, rendering earlier NFTs’ assetToPay values invalid.

Impact

Beneficiaries purchasing earlier NFTs will use the wrong token, leading to failed transactions or unintended token transfers.

Tools Used

Manual review.

Recommendations

Convert assetToPay into a mapping: mapping(uint256 => address) assetToPay. Update setAssetToPay to accept an NFT ID parameter.

Updates

Lead Judging Commences

0xtimefliez Lead Judge 10 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!