Contracts::Event

Variant 97 v393

pallet_contracts::pallet::Event

The `Event` enum of this pallet

About This Type

Event enum for the Event pallet.

Contains all possible events emitted by the Event pallet. Each variant represents a different event type with its own data fields.

Variants (10)

IndexNameFieldsDocs
0Instantiated
deployer: AccountId
contract: AccountId
Contract deployed by address at the specified address.
1Terminated
contract: AccountId
beneficiary: AccountId
Contract has been removed. # Note The only way for a contract to be removed and emitting this event is by calling `seal_terminate`.
2CodeStored
code_hash: H256
deposit_held: u64
uploader: AccountId
Code with the specified hash has been stored.
3ContractEmitted
contract: AccountId
data: Vec<u8>
A custom event emitted by the contract.
4CodeRemoved
code_hash: H256
deposit_released: u64
remover: AccountId
A code with the specified hash was removed.
5ContractCodeUpdated
contract: AccountId
new_code_hash: H256
old_code_hash: H256
A contract's code was updated.
6Called
caller: Origin
contract: AccountId
A contract was called either by a plain account or another contract. # Note Please keep in mind that like all events this is only emitted for successful calls. This is because on failure all storage changes including events are rolled back.
7DelegateCalled
contract: AccountId
code_hash: H256
A contract delegate called a code hash. # Note Please keep in mind that like all events this is only emitted for successful calls. This is because on failure all storage changes including events are rolled back.
8StorageDepositTransferredAndHeld
from: AccountId
amount: u64
Some funds have been transferred and held as storage deposit.
9StorageDepositTransferredAndReleased
from: AccountId
amount: u64
Some storage deposit funds have been transferred and released.

SCALE Encoding

Rule
1-byte variant index followed by variant-specific field data. 10 possible variants.
Size
variable (1+ bytes)

Examples

Instantiated = Instantiated(deployer, contract)
0x00<field0><field1>
00 Variant index 0 = Instantiated
field 0 deployer: AccountId
field 1 contract: AccountId
Terminated = Terminated(contract, beneficiary)
0x01<field0><field1>
01 Variant index 1 = Terminated
field 0 contract: AccountId
field 1 beneficiary: AccountId
CodeStored = CodeStored(code_hash, deposit_held, uploader)
0x02<field0><field1><field2>
02 Variant index 2 = CodeStored
field 0 code_hash: H256
field 1 deposit_held: u64
field 2 uploader: AccountId

Code Examples

import { TypeRegistry } from "@polkadot/types";

const registry = new TypeRegistry();

// Encode Contracts::Event — variant "Instantiated"
const value = registry.createType("Contracts::Event", { Instantiated: { deployer: "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", contract: "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" } });
console.log("Hex:", value.toHex());

Type Parameters

T

Referenced By (23)

and 3 more...

Also See

Type Information

Type ID
97
Kind
Variant
Path
pallet_contracts::pallet::Event
Runtime
v393