pub async fn mng_transfer_ownership(
    contract_id: ContractId,
    principal: Principal
) -> Response
Expand description

Allows the current owner to transfer control of the contract to a new owner.

§Parameters

  • contract_id: Target contract id.
  • principal: The principal to transfer ownership to.

§Result

  • tx_id: Id of the transaction.

§Sample request

CONTRACT_ID=1_376_994_832_725_996_537_612_682_825_051_864_610_558_585_037_795
PRINCIPAL='principal "dimdt-vwpm3-tkwgu-c2nkv-txykr-atn2x-xras5-6xidt-wtti3-i4xr6-vqe"'

dfx canister call coreledger_backend mng_transfer_ownership "($CONTRACT_ID, $PRINCIPAL)"

§Sample response

( record {
  tx_id = 64_902_045_878_680_215_161_103_406_576_570_366_475_824_533_393_005_533_149_888_825_789_042_550_227_580 : nat
})