The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

`vaults()` assumes `collateralRate`, `mintFeeRate` & `burnFeeRate` same for all smartVaults.

Summary

see deatails.

Vulnerability Details

vaults() is a view function which fetches all smartVaults Data for a coresponding caller,
But problem here is that it assumes collateralRate, mintFeeRate & burnFeeRate for vaults is same as current collateralRate, mintFeeRate & burnFeeRate contratct state.

while there are setter functions like setMintFeeRate() setBurnFeeRate() which will changes value of state any time via Owner of contract.

So its possible that during smartVault creation those parameter mintFeeRate & burnFeeRate is different from current value. So this will provide wrong info.

function vaults() external view returns (SmartVaultData[] memory) {
uint256[] memory tokenIds = smartVaultIndex.getTokenIds(msg.sender);
uint256 idsLength = tokenIds.length;
SmartVaultData[] memory vaultData = new SmartVaultData[](idsLength);
for (uint256 i = 0; i < idsLength; i++) {
uint256 tokenId = tokenIds[i];
vaultData[i] = SmartVaultData({
tokenId: tokenId,
collateralRate: collateralRate,
mintFeeRate: mintFeeRate,
burnFeeRate: burnFeeRate,
status: ISmartVault(smartVaultIndex.getVaultAddress(tokenId)).status()
});
}
return vaultData;
}

Impact

User will get wrong info about smartVault

Tools Used

Manual Review

Recommendations

There should individual stoage which store coressponding mintFeeRate and burnFeeRate for smartVaults.

Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

informational/invalid

Support

FAQs

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