Minting CRED to a recipient should either deposit tokens to that account if registered, or safely handle the case when the recipient is unregistered without causing unexpected reverts. However, minting non zero amount to an unregistered account triggers an abort due to clean up because the code mints coins and then calls coin::destroy_zero
which aborts for non zero amounts.
Likelihood: Low
The issue impacts all unregistered users who try to unstake.
Impact: Low
The transaction aborts, however, the user can registered and the issue resolves.
The test proves that transaction aborts when the module owner tries to mint coins to an unregistered account.
It is recommended to update the flow as:
mint only if the amount is greater than zero
if the user is not registered, register them
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.