You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suspect that the amounts contained in the Transfer and Mint events emitted in the _mintScaled() function in ScaledBalanceTokenBase.sol are incorrect. This doesn't appear to be fixed in PR 682 (similar issue).
The issue appears in the MintToTreasury() transaction on avax mainnet at block 15154957. Details using eth-brownie on just the aAvaWAVAX portion of this transaction:
balance_before = awavax.balanceOf('0x5ba7fd868c40c16f7aDfAe6CF87121E13FC2F7a0', block_identifier = 15154956)
balance_after = awavax.balanceOf('0x5ba7fd868c40c16f7aDfAe6CF87121E13FC2F7a0', block_identifier = 15154957)
print(f'Treasury aAvaWAVAX balanceOf() at block 15154956 is {balance_before}')
print(f'Treasury aAvaWAVAX balanceOf() at block 15154957 is {balance_after}')
print(f'delta is {balance_after - balance_before}')
Output:
Treasury aAvaWAVAX balanceOf() at block 15154956 is 767685076087066672333
Treasury aAvaWAVAX balanceOf() at block 15154957 is 4193524073182740554855
delta is 3425838997095673882522
Note that the Mint and Transfer events value is the same as the final balanceOf(), instead of the amount the balance was incremented by. The MintedToTreasury event appears to contain the correct value.
I suspect the issue lies with line 86 in ScaledBalanceTokenBase.sol
Appreciate any further understanding if I haven't interpreted this correctly.
The text was updated successfully, but these errors were encountered:
Hey @scottincrypto, It's nice to see people digging into the event details!
The code is correct and working as expected. Let me explain:
MintedToTreasury event emits the amount of new aTokens minted on behalf of the treasury.
Transfer and Mint events emit the amount of aTokens the receiver gets (minted + accrued interests).
So,
MintedToTreasury is emitting 3425838995935281232338 because is the amount new aTokens minted to the treasury.
Transfer is emitting 4193524073182740554855 because is the total amount of aTokens that the treasury is getting.
Mint is emitting 4193524073182740554855 as value (total amount the treasury is getting) and 767685077247459322517 as balanceIncrease (accrual amount of interests).
I suspect that the amounts contained in the Transfer and Mint events emitted in the _mintScaled() function in ScaledBalanceTokenBase.sol are incorrect. This doesn't appear to be fixed in PR 682 (similar issue).
The issue appears in the MintToTreasury() transaction on avax mainnet at block 15154957. Details using eth-brownie on just the aAvaWAVAX portion of this transaction:
Output:
Output:
Note that the Mint and Transfer events
value
is the same as the finalbalanceOf()
, instead of the amount the balance was incremented by. The MintedToTreasury event appears to contain the correct value.I suspect the issue lies with line 86 in ScaledBalanceTokenBase.sol
Appreciate any further understanding if I haven't interpreted this correctly.
The text was updated successfully, but these errors were encountered: