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

**URL:** https://forum.dfinity.org/t/completed-icdevs-org-bounty-26-icrc-1-motoko-up-to-10k/14868
**Category:** Bounties & RFPs
**Tags:** Discussing
**Created:** [August 14, 2022, 4:16pm UTC](https://forum.dfinity.org/t/completed-icdevs-org-bounty-26-icrc-1-motoko-up-to-10k/14868 "2022-08-14T16:16:12Z")
**Posts on this page:** 5
**Page:** 4

<div class="post-metadata">

### Author: ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)
#### Post date: [January 26, 2023, 12:46pm UTC](https://forum.dfinity.org/t/completed-icdevs-org-bounty-26-icrc-1-motoko-up-to-10k/14868/64 "2023-01-26T12:46:00Z")

</div>

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](https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-1/README.md)

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

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

---

<div class="post-metadata">

### Author: ![roman-kashitsyn](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/roman-kashitsyn/32/3802_2.png) [@roman-kashitsyn](https://forum.dfinity.org/u/roman-kashitsyn)
#### Post date: [January 27, 2023, 1:06pm UTC](https://forum.dfinity.org/t/completed-icdevs-org-bounty-26-icrc-1-motoko-up-to-10k/14868/65 "2023-01-27T13:06:44Z")

</div>

> [@skilesare](#):
>
> This is odd. @roman-kashitsyn any idea why this is the case?

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:

> **[icrc1.did?L2](https://sourcegraph.com/github.com/dfinity/ic@c790f6d033be1c943e0a068333c9ffc6f8e2de36/-/blob/rs/rosetta-api/icrc1/ledger/icrc1.did?L2)**

---

<div class="post-metadata">

### Author: ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)
#### Post date: [February 28, 2023, 3:44pm UTC](https://forum.dfinity.org/t/completed-icdevs-org-bounty-26-icrc-1-motoko-up-to-10k/14868/66 "2023-02-28T15:44:11Z")

</div>

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

> <https://github.com/NatLabs/icrc1/pull/6>
>
> I needed await\* for processing many transactions at a time.

---

<div class="post-metadata">

### Author: ![sardariuss](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/sardariuss/32/39258_2.png) [@sardariuss](https://forum.dfinity.org/u/sardariuss)
#### Post date: [April 5, 2023, 10:07pm UTC](https://forum.dfinity.org/t/completed-icdevs-org-bounty-26-icrc-1-motoko-up-to-10k/14868/67 "2023-04-05T22:07:35Z")

</div>

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:

Another fee related issue:

> <https://github.com/NatLabs/icrc1/issues/8>
>
> Currently it is:if (tx\_req.amount \> balance + token.\_fee) {
> 
> It shall be: if (…tx\_req.amount + token.\_fee \> balance) {
> 
> Luckily right now it traps with a "Natural subtraction underflow" preventing the transfer. But it should return the error #InsufficientFunds instead.
> 
> Way to reproduce: transfer the exact balance from the account (without subtracting the fee from it).
> 
> Ultimatly it would be nice to have a test for it :)

---

<div class="post-metadata">

### Author: ![roman-kashitsyn](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/roman-kashitsyn/32/3802_2.png) [@roman-kashitsyn](https://forum.dfinity.org/u/roman-kashitsyn)
#### Post date: [April 6, 2023, 9:55am UTC](https://forum.dfinity.org/t/completed-icdevs-org-bounty-26-icrc-1-motoko-up-to-10k/14868/68 "2023-04-06T09:55:55Z")

</div>

> [@sardariuss](#):
>
> I suppose they agree if the argument fee is greater than the ledger fee ?

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

[Previous page](https://forum.dfinity.org/t/completed-icdevs-org-bounty-26-icrc-1-motoko-up-to-10k/14868.md?page=3)
