release_deposit

Call v154 → current #6

Release a deposit from a past safe-mode activation/extension.

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: validatorsdevelopers

The Big Picture

After safe-mode ends and ReleaseDelay passes, depositors can reclaim their funds. The delay gives governance time to assess whether activations were legitimate.

Use Cases

  • Reclaim deposit after safe-mode concludes
  • Recover funds from legitimate activation

From Chain Metadata

Permissionlessly release a deposit for an account that entered safe-mode at a given historical block. The call can be completely disabled by setting [`Config::ReleaseDelay`] to `None`. This cannot be called while safe-mode is entered and not until [`Config::ReleaseDelay`] blocks have passed since safe-mode was entered. Emits a [`Event::DepositReleased`] event on success. Errors with [`Error::Entered`] if the safe-mode is entered. Errors with [`Error::CannotReleaseYet`] if [`Config::ReleaseDelay`] block have not passed since safe-mode was entered. Errors with [`Error::NoDeposit`] if the payee has no reserved currency at the block specified.

Input Parameters

#NameTypeDescription
0
account
AccountId Account account address (hex -> SS58)
1
block
u32 block (u32)

Permissions

Origin
Unknown
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Safe-mode is not currently entered
  • ReleaseDelay blocks have passed since the activation block
  • Account has a deposit at the specified block

Effects

Events Emitted

Storage Modified

Postconditions

  • Deposit unreserved and returned to account
  • DepositReleased event emitted

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Build release_deposit call
const account = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const block = 0;

const call = api.tx[stringCamelCase("SafeMode")][stringCamelCase("release_deposit")](
  account,
  block
);

Runtime Info

Pallet Index
20
Call Index
6
First Version
v154
Current Version
v393