HardhatDeFi
15,000 USDC
View results
Submission Details
Severity: medium
Invalid

AaveDIVAWrapper Lacks Token-Specific Emergency Pause Controls Forcing Full Shutdown for Individual Token Issues

Description

The AaveDIVAWrapper contract lacks a mechanism to pause operations for specific collateral tokens in emergency scenarios. Once a token is registered, operations with that token can only be stopped by pausing the entire contract or through contract redeployment.

Current implementation has no per-token pause functionality:

https://github.com/Cyfrin/2025-01-diva/blob/main/contracts/src/AaveDIVAWrapperCore.sol#L71

function _registerCollateralToken(address _collateralToken) internal returns (address) {
// Token remains active indefinitely once registered
_collateralTokenToWToken[_collateralToken] = _wToken;
_wTokenToCollateralToken[_wToken] = _collateralToken;
}
function _handleTokenOperations(address _collateralToken, uint256 _collateralAmount, address _wToken) private {
// No ability to pause specific token operations
IERC20Metadata(_collateralToken).safeTransferFrom(...);
IAave(_aaveV3Pool).supply(...);
IWToken(_wToken).mint(...);
}

Impact

Critical scenarios requiring immediate token suspension:

  1. Token contract compromise discovered

  2. Aave protocol issues with specific token

  3. Suspicious activity patterns detected

  4. Token upgrade complications

  5. Market-wide token-specific issues

Recommended Fix

Add token-specific pause functionality:

contract AaveDIVAWrapperCore {
mapping(address => bool) public tokenPaused;
error TokenPaused(address token);
function pauseToken(address token) external onlyOwner {
tokenPaused[token] = true;
emit TokenPaused(token);
}
function unpauseToken(address token) external onlyOwner {
tokenPaused[token] = false;
emit TokenUnpaused(token);
}
function _handleTokenOperations(
address _collateralToken,
uint256 _collateralAmount,
address _wToken
) private {
if (tokenPaused[_collateralToken]) {
revert TokenPaused(_collateralToken);
}
// Existing operations...
}
// Emergency bulk pause
function pauseTokens(address[] calldata tokens) external onlyOwner {
for (uint256 i = 0; i < tokens.length; i++) {
tokenPaused[tokens[i]] = true;
emit TokenPaused(tokens[i]);
}
}
}

The fix provides critical emergency control without requiring full protocol shutdown or redeployment.

Updates

Lead Judging Commences

bube Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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

Give us feedback!