protocol-v2 icon indicating copy to clipboard operation
protocol-v2 copied to clipboard

Bug in StableDebtToken event emitting

Open Parean opened this issue 4 years ago • 0 comments

I probably found some bug in event emitting. In Mint event of StableDebtToken there is an invariant: newBalance == oldBalance + balanceIncrease + amount. But here https://github.com/aave/protocol-v2/blob/master/contracts/protocol/tokenization/StableDebtToken.sol#L243 you put to amount field the number that is equal to balanceIncrease - burnedAmount, without setting balanceIncrease field to 0. Because of that I need to handle this instance of Mint differently from instance that is emitted here https://github.com/aave/protocol-v2/blob/master/contracts/protocol/tokenization/StableDebtToken.sol#L178

(specifically, when updating balance: newBalance = oldBalance + amount, without adding balanceIncrease). It creates the need to write dirty hacks, because now I should know where precisely this event was emitted, in burn or in mint function.

Parean avatar Jul 28 '21 14:07 Parean