Completed: ICDevs.org - Bounty #26 - ICRC-1 Motoko - up to $10k

The official type is Blob which puts the SNS out of compliance with the standard. ICRC-1/README.md at main · dfinity/ICRC-1 · GitHub

This is odd. @roman-kashitsyn any idea why this is the case?

Blob.toArray(x) blob.fromArray(x) should get rid of the errors.

2 Likes

It appears to be a Motoko-specific problem, or rather the problem with generating Motoko bindings for .did files. Both the ICP ledger and the SNS-1 implementation are implemented in Rust and use the same Account type. The interface files for these ledgers specify that the subaccount is a blob:

I submitted a pull request today updating this library to use aync* which really helps with batch transfers.

1 Like

The ICRC-1 standard specifies:

The caller pays the fee. If the caller does not set the fee argument, the ledger applies the default transfer fee. If the fee argument does not agree with the ledger fee, the ledger MUST return variant { BadFee = record { expected_fee = ... } } error.

  • What does “agree” mean here ? I suppose they agree if the argument fee is greater than the ledger fee ?

  • In the current ICRC-1 implementation, which seems to differ from the spec:

    • if the argument fee is set to null (and the ledger fee is >0), the error BadFee is returned
    • whatever fee is passed as argument, it is always the ledger fee that is burnt

Another fee related issue:

They “agree” if the client fee and the ledger fee are exactly equal.