ICRC1 provides the change_fee_collector
field. If icrc1 canister has been deployed, how do I modify it?
change_fee_collector
is included as an upgrade arg so you can set it when you upgrade the canister.
You can learn more about upgrading a canister here.
However, this should work (with an optional subaccount; add the subaccount if needed):
dfx canister install <icrc1_canister_name_or_id> --mode upgrade --argument '(
variant {
Upgrade = record {
change_fee_collector = opt variant {
SetTo = record {
owner = principal "whatever_principal_you can_to_set_this_to";
subaccount = null;
}
};
}
}
)'
Thanks for your reply, but if my icrc1_canister is a launched sns, can I modify it? @jennifertran
An upgrade should preserve the state of a deployed canister and change the code. However, let me double-check if there is anything that you need to consider before running this.
Thank you jennifertran
You should be able to update this as long as you upgrading the canister as specified above.
An upgrade should preserve the state of a deployed canister and change the code.
Hello, @jennifertran
Iām sorry that I expressed it incorrectly. The icrc1 canister I want to change has already been launched SNS. In this case, how do I modify the fee collector?
Are you getting an error or running into an issue? I assume that you are asking how to create a proposal for this update.
Can you please confirm the canister ID on which you are running this? Can you please confirm the full command?
Could you remove mentioning the subaccount altogether?
dfx.json:
{
"canisters": {
"icrc1_ledger": {
"type": "custom",
"candid": "icrc1_ledger.did",
"wasm": "https://download.dfinity.systems/ic/3bcccef07408921fe849c92dd2437adc157ef9c3/canisters/ic-icrc1-ledger.wasm.gz",
"declarations": {
"bindings": ["js", "did"],
"env_override": null,
"output": "declarations"
}
}
},
"networks": {
"staging": {
"providers": ["https://icp0.io"],
"type": "persistent"
}
}
}
canister_ids.json:
{
"icrc1_ledger": {
"ic": "atbfz-diaaa-aaaaq-aacyq-cai"
}
}
The upgrade command
dfx canister --network ic install icrc1_ledger --mode upgrade --argument '(
variant {
Upgrade = record {
change_fee_collector = opt variant {
SetTo = record {
owner = principal "auadn-oqaaa-aaaaq-aacya-cai";
subaccount = null;
}
};
}
}
)'
Hello @anywn,
Thank you for sending this over!
I confirmed with the team that updating the fee_collector
is not possible on SNS Ledger Canisters at the moment.