From 3b73b1c6332d79892c7ccb8cc28a2641381406bd Mon Sep 17 00:00:00 2001 From: sideffect0 Date: Fri, 10 May 2024 20:33:15 +0530 Subject: [PATCH] fix burn for minter account --- src/token/main.mo | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/token/main.mo b/src/token/main.mo index 5f87d3c..00904da 100644 --- a/src/token/main.mo +++ b/src/token/main.mo @@ -266,7 +266,12 @@ shared(msg) actor class ICRC1Canister(args : {tokenOwner : Principal}) = this { (result: TxnResult) { let from = _from; let to = _to; - let operation: Operation = #transfer({ action = #send; }); + // destination is minter or not + let operation: Operation = if(_to == owner_){ + #transfer({ action = #burn; }); + } else { + #transfer({ action = #send; }); + }; // check fee if(not(_checkFee(from, _value))){ return #err({ code=#InsufficientBalance; message="Insufficient Balance"; });