I spent several hours trying to fix this:
dfx deploy --no-compile --network local --argument " (variant { Init = record { minting_account = \"INTER_ACCOUNT_ID\"; initial_values = vec { record { \"EFAULT_ACCOUNT_ID\"; record { e8s = 10_000_000_000 : nat64; }; }; }; send_whitelist = vec {}; transfer_fee = opt record { e8s = 10_000 : nat64; }; token_symbol = opt \"LICP\"; token_name = opt \"Local ICP\"; } })" nns-ledger
Deploying: nns-ledger
All canisters have already been created.
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to install all canisters.
Caused by: Failed to install wasm module to canister 'nns-ledger'.
Caused by: Failed during wasm installation call
Caused by: The replica returned a rejection error: reject code CanisterError, reject message Error from Canister uxrrr-q7777-77774-qaaaq-cai: Canister called `ic0.trap` with message: 'Unable to decode init argument.
Decode as new init returned the error Fail to decode argument 0
Decode as old init returned the error Fail to decode argument 0'.
Consider gracefully handling failures from this canister or altering the canister to handle exceptions. See documentation: https://internetcomputer.org/docs/current/references/execution-errors#trapped-explicitly, error code Some("IC0503")
(--no-compile
is a flag of a custom DFX version, you can remove it.)
From https://github.com/vporton/truth-portal:
"nns-ledger": {
"type": "custom",
"candid": "https://raw.githubusercontent.com/dfinity/ic/16825c5cbff83a51983d849b60c9d26b3268bbb6/rs/ledger_suite/icp/ledger.did",
"wasm": "https://download.dfinity.systems/ic/16825c5cbff83a51983d849b60c9d26b3268bbb6/canisters/ledger-canister.wasm.gz",
"remote": {
"id": {
"ic": "ryjl3-tyaaa-aaaaa-aaaba-cai"
}
}
}
It seems I hit a bug in DFX:
$ dfx --version
dfx 0.24.3+rev708.7f1d6ebb
but when I compile it:
$ cargo build --release && cp target/release/dfx ~/bin/
Compiling dfx v0.26.1 (/home/porton/Projects/sdk/src/dfx)
and in CHANGELOG.md
:
# 0.27.0