Function pallet_contracts::pallet::dispatchables::set_code
source · pub fn set_code<T: Config>(
dest: <<T as Config>::Lookup as StaticLookup>::Source,
code_hash: <T as Config>::Hash,
)
Expand description
Privileged function that changes the code of an existing contract.
This takes care of updating refcounts and all other necessary operations. Returns
an error if either the code_hash
or dest
do not exist.
§Note
This does not change the address of the contract in question. This means that the contract address is no longer derived from its code hash after calling this dispatchable.
§Warning: Doc-Only
This function is an automatically generated, and is doc-only, uncallable
stub. See the real version in
Pallet::set_code
.