Function ink_env::lock_delegate_dependency

source ·
pub fn lock_delegate_dependency<E>(code_hash: &E::Hash)
where E: Environment,
Expand description

Adds a new delegate dependency lock to the contract.

This guarantees that the code of the dependency cannot be removed without first calling unlock_delegate_dependency. It charges a fraction of the code deposit, see pallet_contracts::Config::CodeHashLockupDepositPercent for details.

§Errors

  • If the supplied code_hash cannot be found on-chain.
  • If the code_hash is the same as the calling contract.
  • If the maximum number of delegate dependencies is reached.
  • If the delegate dependency already exists.