Dfx ledger top-up sent ICP instead of cycles

Hello @alex_kaffetzakis!

You can view this detailed reference on the dfx ledger top-up command.

As explained in the doc, dfx ledger top-up is a command to top up a canister with cycles minted from ICP tokens. It cannot only send ICP to the canister.

A couple of things that might be helpful:

  1. Are you sure that the command did not result in an error?

This command attempts to send 3536000000 ICP to the canister.
dfx ledger top-up --amount 3536000000 <canister_id> --network ic

I wish you had but doubt that you had this amount in your account. The command line should have returned an error similar to this:

Error: Failed to transfer funds.
Caused by: Failed to transfer funds.
The debit account doesn't have enough funds to complete the transaction, current balance: 0.10000000 ICP
  1. Could you have topped up the wrong canister?

Based on the transaction details that you provided, there is a possibility that you did top up a canister with 3536000000 ICP in E8S value (which is 3.53 ICP).

I think what might be confusing is that explorers and the IC data dashboard might show that x ICP is being sent from your ICP account ID to the canister’s principal ID.

For example, my account ID is 96cd8d62a91d777892a568a4093e7c250aceab7e6f82b3e1d3a6b5282eda3563 and I ran this command to send 0.00001 ICP to canister zndrp-vqaaa-aaaao-a3i6a-cai on mainnet.

dfx ledger top-up --amount 0.00001 zndrp-vqaaa-aaaao-a3i6a-cai --network ic

On the ICP data dashboard, this is going to show that 96cd8d62a91d777892a568a4093e7c250aceab7e6f82b3e1d3a6b5282eda3563 sent 0.00001 from to the canister’s account address: 3c86d912ead6de7133b9f787df4ca9feee07bea8835d3ed594b47ee89e6cb730:
Transaction: 6c466981423f5c9496f486a215628aa2f8f35d584a05ed309978e63506a34cab - ICP Dashboard.

For more troubleshooting, I would suggest:

  1. Get the account address that you believe that you used to send ICP to cycles to the canister.

dfx ledger account-id

  1. Get the canister’s account address:
  1. Then search for your account address on the IC Data Dashboard.

Do you see the intended transaction under the ICP Transaction section?

It should be from your account address to the canister module hash.

Hope that helps! Please do reply with any details that you may have uncovered from this!

3 Likes