dfinity / ICRC-1

A fungible token standard developed by the Ledger & Tokenization working group for the IC.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BUG - icrc2_approve method assertion

franRappazzini opened this issue · comments

hi! i think that in this line of icrc2_approve method there is a problem.. let's go with my explanation

assert (balance(approverAccount, log) == overflowOk(approverBalance - effectiveFee));

let's suppose my balance is 100000 and the token fee is 10000, so when that line is executed it never will pass the assert.
why? because balance(approverAccount, log) will be 100000 and overflowOk(approverBalance - effectiveFee) will be 90000 (100000 approverBalance - 10000 effectiveFee = 90000).

So the assert would be like this:

assert (100000 == 90000)

and obviously that will never pass. i will be on the lookout for any response and i will gladly help to resolve it.