How to correctly specify a memo to create a canister using icrc1_transfer?

I get an error

Error: The transaction does not satisfy the cycle minting canister payment protocol. Desciption: Intent in the block (0 == unrecognized: Memo(0)) different than in the notification (1095062083 == CreateCanister)

when trying to call CMC.notify_create_canister(...)

I send ICP using icrc1_transfer, so I need a memo in Blob, there are no problems with transfer, but I need a new icrc2_transfer_from to pay from other accounts. That’s why I started by using icrc1_transfer.

motoko code
let fromSubaccount : A.Subaccount = A.principalToSubaccount(invoice.owner);
let account : LedgerTypes.Account = {
    owner = Principal.fromText(CYCLE_MINTING_CANISTER_ID);
    subaccount = ?A.canisterToSubaccount(self);
};
let result = await Ledger.icrc1_transfer({
    to = account;
    fee = ?FEE;
    memo = ?Text.encodeUtf8("CREA");
    from_subaccount = ?fromSubaccount;
    amount;
    created_at_time = ?Nat64.fromNat(Int.abs(Time.now()));
});

Also I try directly with js, same error.

How to correctly specify memo for icrc1_* api?

I’m getting an error somewhere here, but I don’t understand how to get around it.

Hi @rabbithole,

I don’t think that’s possible at the moment. ICRC_1 populates the ICRC_1 memo of a transaction, but the cycles minting canister (which is the canister that mints the cycles out of the ICPs you send) is still oblivious to that field; it only looks at the “old” u64 memo so it sees 0 (which I think is the default value).

5 Likes

Thanks for the quick response! I was hoping to remove the internal user account and use the allowances from ICRC-2. It turns out I have to postpone this until better times.

Yes: until the CMC canisters hears about the new ICRC standards :slight_smile: – but this is a good datapoint when we prioritise the work we pick up

1 Like