Skip to content

Latest commit

 

History

History
39 lines (21 loc) · 1.75 KB

071.md

File metadata and controls

39 lines (21 loc) · 1.75 KB

Gorgeous Jade Falcon

High

Incorrect Token Treatment by MAINTAINER_ROLE

Summary

The current design in StablecoinHandler.sol allows for the MAINTAINER_ROLE to update XYZ token settings after AmirX has begun transactions, potentially causing unintended token treatment. If a token is initially treated as a regular ERC20, but later updated to be an XYZ token, it may lead to discrepancies in supply and behavior for users as the system transitions from transferring tokens to minting/burning them instead.

Root Cause

In StablecoinHandler.sol: 281, the choice to let the MAINTAINER_ROLE update XYZ tokens status at any point causes an inconsistency, as tokens previously treated as regular ERC20's will start being minted or burned.

Internal pre-conditions

  1. MAINTAINER_ROLE updates a previously regular ERC20 token to be an XYZ token.
  2. Swaps or transfers of this token already occurred before the update.

External pre-conditions

No response

Attack Path

  1. The MAINTAINER_ROLE updates the XYZ status of a token after transactions have started.
  2. The contract begins treating the token as an XYZ, minting/burning rather than transferring, leading to unexpected behavior or locked funds.

Impact

The protocol experiences inconsistent token handling, potentially resulting in supply discrepancies or trapped funds in the liquidity pool due to mismatched expectations for regular vs. XYZ token treatment.

PoC

No response

Mitigation

Require that all XYZ tokens be defined before transactions begin on the AmirX contract to ensure consistent behavior.