Issue with ICRC-1 Transfer and Default Transaction Fee

I am currently working on a project where one of my colleagues is using a precompiled Wasm instead of writing the ICRC-1 ledger code manually. When calling icrc1_transfer to transfer tokens from the pool to the user, I encounter the following error:

2021-05-06 19:17:10.000000020 UTC: [Canister lz3um-vp777-77777-aaaba-cai] ❌ Transfer failed: Insufficient funds. Available balance: Nat(100)

I suspect that the Wasm implementation of the ICRC-1 ledger might have a default transaction fee of 100 tokens. Since the pool balance is exactly 100 tokens, the transfer fails due to insufficient funds (i.e., it requires amount + fee to be available).

1 Like

Hi @jyotirmaygithub!
In the DFINITY Rust ICRC ledger implementation, the transaction fee is a mandatory configuration option that must be set when the ledger is deployed, i.e., there is no default transaction fee specified in the code, nor in any prebuild WASM. The transfer fee can also be changed in the upgrade arguments.

But is it a good practice or right approach to use wasm instead of writing code.

currently I would say that this is the recommended approach to use the pre-built wasm.

however, you could implement your own custom code. then you should make sure to adhere to the standards to enable integration in wallets, defi protocols, …

we recognize that there is demand for easy customizable code and are thinking about how to approach this

can this be set to zero on deployment? or is this currently enforced to be > 0 and must be updated afterwards? (never checked this in detail before)

1 Like

If you need a zero fee or some other feee scheme, the pan industrial icrc1 token will let you customize behavior fairly easily. In the example is a whitelist token with 0 fee.

1 Like