Core Contracts

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

RAACToken.sol have incorrect condition implementation in _update function

Summary

In RAACToken , function _update is using the wrong condition , it uses the address zero and in this condition is updating the function .

Vulnerability Details

In RAACToken , function _update is using the wrong condition , it uses the address zero and in this condition is updating the function .

if (baseTax == 0 || from == address(0) || to == address(0) || whitelistAddress[from] || whitelistAddress[to] || feeCollector == address(0)) {
super._update(from, to, amount); // q why is the condition for from == address(0) here?
return;
function _update(
address from,
address to,
uint256 amount
) internal virtual override {
uint256 baseTax = swapTaxRate + burnTaxRate;
// Skip tax for whitelisted addresses or when fee collector disabled
if (baseTax == 0 || from == address(0) || to == address(0) || whitelistAddress[from] || whitelistAddress[to] || feeCollector == address(0)) {
super._update(from, to, amount); // q why is the condition for from == address(0) here?
return;
}
// All other cases where tax is applied
uint256 totalTax = amount.percentMul(baseTax);
uint256 burnAmount = totalTax * burnTaxRate / baseTax;
super._update(from, feeCollector, totalTax - burnAmount); // q why we are subtracting burnAmount from total tax not from ammount .
super._update(from, address(0), burnAmount);
super._update(from, to, amount - totalTax);
}

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

Impact

  1. If-else condition will check for address zero and update the function . so , the ammount is diverted in zero account and fund loss will happen

Tools Used

  1. Manual Review

Recommendations

  1. Change the condition .

  2. Do not allow the address zero to make changes .

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Appeal created

shubu2581 Submitter
4 months ago
inallhonesty Lead Judge
4 months ago
inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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