Core Contracts

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

Reentrancy Risk in deposit on Treasury.so

Summary

Both the deposit and withdraw functions involve external calls (transferring tokens). Although the ReentrancyGuard modifier is used, it's important to ensure state updates are made before external calls to prevent reentrancy.

Vulnerability Details

IERC20(token).transferFrom(msg.sender, address(this), amount);
_balances[token] += amount;
_totalValue += amount;

Impact

A malicious actor could exploit the reentrancy vulnerability by calling back into the deposit or withdraw function before the state updates are completed, leading to multiple deposits.

Tools Used

Recommendations

Update the state before making external calls (token transfers) to ensure the contract cannot be exploited through reentrancy.

_balances[token] += amount;
_totalValue += amount;
IERC20(token).transferFrom(msg.sender, address(this), amount);
Updates

Lead Judging Commences

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

Support

FAQs

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