Core Contracts

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

before transferring debt token update state should be called in lending pool

Summary

before transferring debt token update state should be called in lending pool

Vulnerability Details

Following is from the debt token contract

function _update(address from, address to, uint256 amount) internal virtual override {
if (from != address(0) && to != address(0)) {
revert TransfersNotAllowed(); // Only allow minting and burning
}
uint256 scaledAmount = amount.rayDiv(ILendingPool(_reservePool).getNormalizedDebt());
super._update(from, to, scaledAmount);
emit Transfer(from, to, amount);
}

So in order to correctly transfer the tokens getnormalized debt should return the latest value for that we need to call the update stae function on the lending pool contract which updates the uasga index upto date.

Impact

Incorrect scaled amount

Tools Used

Recommendations

Call update state function befroe calculating the scaled amount.

Updates

Lead Judging Commences

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

LendingPool::getNormalizedIncome() and getNormalizedDebt() returns stale data without updating state first, causing RToken calculations to use outdated values

Support

FAQs

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