Thanks for the reply, I’ve figured it out.
Here are some examples of how to interact with the management canister(ic0), hope this will help the others.
public shared(msg) func setController(canisterId: Principal): async Bool {
switch(tokens.get(canisterId)) {
case(?info) {
assert(msg.caller == info.owner);
let controllers: ?[Principal] = ?[msg.caller, Principal.fromActor(this)];
let settings: CanisterSettings = {
controllers = controllers;
compute_allocation = null;
memory_allocation = null;
freezing_threshold = null;
};
let params: UpdateSettingsParams = {
canister_id = canisterId;
settings = settings;
};
await IC.update_settings(params);
return true;
};
case(_) { return false };
}
This file has been truncated. show original