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

Individual NFT payment tokens were intended but globally shared token was implemented

Description:

The Inheritable Smart Contract Wallet protocol appears to be designed with the intention that each NFT would have its own associated payment token, but the implementation uses a single global assetToPay variable affecting all NFTs simultaneously.

This misalignment between intended design and actual implementation is evident when examining these functions:

// In InheritanceManager.sol
function createEstateNFT(string memory _description, uint256 _value, address _asset) external onlyOwner {
uint256 nftID = nft.createEstate(_description);
nftValue[nftID] = _value;
assetToPay = _asset; // Overwrites global variable instead of setting per NFT
}

While this function accepts a token address parameter for each new NFT created, suggesting a per-NFT payment token, it actually overwrites the global assetToPay variable. Similarly, individual NFT values are stored correctly in a mapping, but token addresses are not:

// In Trustee.sol - Individual values per NFT
mapping(uint256 NftIndex => uint256 value) nftValue;
// But only a global token for all NFTs
address assetToPay;

The trustee can also change this global token, affecting all NFTs at once:

function setAssetToPay(address _asset) external onlyTrustee {
assetToPay = _asset; // Changes token for ALL NFTs
}

Impact:

The contract functions suggest an intent to assign individual tokens to NFTs, but the implementation forces all NFTs to share one token.

The createEstateNFT function misleadingly appears to set a token for a specific NFT but actually changes it globally.

The protocol fails to properly represent real-world assets that would naturally be valued in different currencies.

Each new NFT creation overwrites the payment token for all previously created NFTs, creating a "last one wins" scenario.

Recommended Mitigation:

Align the implementation with the apparent design intent by creating a mapping for individual NFT payment tokens

Updates

Lead Judging Commences

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

global asset in NFT values

0xtimefliez Lead Judge 3 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.