Skip to content

Commit

Permalink
fix burn for minter account
Browse files Browse the repository at this point in the history
  • Loading branch information
sideffect0 committed May 10, 2024
1 parent eeb69a5 commit 3b73b1c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/token/main.mo
Original file line number Diff line number Diff line change
Expand Up @@ -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"; });
Expand Down

0 comments on commit 3b73b1c

Please sign in to comment.