Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: low
Invalid

The value of `amount` is equal to previous `amount` in `Burn function` in DebtToken.sol contract

Summary

In burn function in contract DebtToken we are making the value of amount equals to amount .

Vulnerability Details

Here , in the function Burn function we can see that we are doing the value of amount equals to amount which doesnot add some new functionality to the function .

amount = amount; this is the thing .

if (\_userState\[from].index != 0 && \_userState\[from].index < index) {
uint256 borrowIndex = ILendingPool(\_reservePool).getNormalizedDebt();
balanceIncrease = userBalance.rayMul(borrowIndex) - userBalance.rayMul(\_userState\[from].index);
amount = amount; // @audit-Info
};
function burn(
address from,
uint256 amount,
uint256 index
) external override onlyReservePool returns (uint256, uint256, uint256, uint256) {
if (from == address(0)) revert InvalidAddress();
if (amount == 0) {
return (0, totalSupply(), 0, 0);
}
uint256 userBalance = balanceOf(from);
uint256 balanceIncrease = 0;
if (_userState[from].index != 0 && _userState[from].index < index) {
uint256 borrowIndex = ILendingPool(_reservePool).getNormalizedDebt();
balanceIncrease = userBalance.rayMul(borrowIndex) - userBalance.rayMul(_userState[from].index);
amount = amount; //q ammount = amount; is this okk ? HERE
}
_userState[from].index = index.toUint128();
if(amount > userBalance){
amount = userBalance;
}
uint256 amountScaled = amount.rayDiv(index);
if (amountScaled == 0) revert InvalidAmount();
_burn(from, amount.toUint128());
emit Burn(from, amountScaled, index);
return (amount, totalSupply(), amountScaled, balanceIncrease);
}

https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/tokens/DebtToken.sol#L197

Impact

  1. The value of amount will remain same as previous amount . so , if anywhere the value of amount changed and we have to store that value then it will not changed .

Tools Used

Manual Review

Recommendations

  1. Recheck the function if we have to make the value of amount equals to some other parameter or remove the line .

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Appeal created

shubu2581 Submitter
4 months ago
inallhonesty Lead Judge
4 months ago
inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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