I made transactions on a simple EVM DEX contract.
I initially called the approve
method which only triggered balances.withdraw
event. I understand that this event is triggered as calling this write-method requires transaction fees.
I then triggered the addLiquidity
method on the contract which is payable and thus should receive the native token
while this method is executed. While executing this transaction, I see that there are both balances.withdraw
and balances.deposit
. I don't understand why it didn't just withdraw
all the required transaction fee at once, instead of withdrawing a larger portion and then depositing back some later on.
What is the cause for this?