Gorgeous Jade Falcon
High
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.
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.
MAINTAINER_ROLE
updates a previously regularERC20
token to be anXYZ
token.- Swaps or transfers of this token already occurred before the update.
No response
- The
MAINTAINER_ROLE
updates theXYZ
status of a token after transactions have started. - The contract begins treating the token as an XYZ, minting/burning rather than transferring, leading to unexpected behavior or locked funds.
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.
No response
Require that all XYZ tokens be defined before transactions begin on the AmirX
contract to ensure consistent behavior.