Contracts::Event
Variant 97 v393pallet_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)
| Index | Name | Fields | Docs |
|---|---|---|---|
| 0 | Instantiated | Contract deployed by address at the specified address. | |
| 1 | Terminated | Contract has been removed. # Note The only way for a contract to be removed and emitting this event is by calling `seal_terminate`. | |
| 2 | CodeStored | Code with the specified hash has been stored. | |
| 3 | ContractEmitted | A custom event emitted by the contract. | |
| 4 | CodeRemoved | A code with the specified hash was removed. | |
| 5 | ContractCodeUpdated | A contract's code was updated. | |
| 6 | Called | 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. | |
| 7 | DelegateCalled | 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. | |
| 8 | StorageDepositTransferredAndHeld | Some funds have been transferred and held as storage deposit. | |
| 9 | StorageDepositTransferredAndReleased | 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 = Instantiatedfield 0 deployer: AccountIdfield 1 contract: AccountIdTerminated = Terminated(contract, beneficiary)
0x01<field0><field1>01 Variant index 1 = Terminatedfield 0 contract: AccountIdfield 1 beneficiary: AccountIdCodeStored = CodeStored(code_hash, deposit_held, uploader)
0x02<field0><field1><field2>02 Variant index 2 = CodeStoredfield 0 code_hash: H256field 1 deposit_held: u64field 2 uploader: AccountIdCode 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)
#21 RuntimeEvent via System#21 RuntimeEvent via Grandpa#21 RuntimeEvent via Balances#21 RuntimeEvent via TransactionPayment#21 RuntimeEvent via SubtensorModule#21 RuntimeEvent via Utility#21 RuntimeEvent via Sudo#21 RuntimeEvent via Multisig#21 RuntimeEvent via Preimage#21 RuntimeEvent via Scheduler#21 RuntimeEvent via Proxy#21 RuntimeEvent via Registry#21 RuntimeEvent via Commitments#21 RuntimeEvent via AdminUtils#21 RuntimeEvent via SafeMode#21 RuntimeEvent via Ethereum#21 RuntimeEvent via EVM#21 RuntimeEvent via BaseFee#21 RuntimeEvent via Drand#21 RuntimeEvent via Crowdloan
and 3 more...
Also See
Type Information
- Type ID
- 97
- Kind
- Variant
- Path
- pallet_contracts::pallet::Event
- Runtime
- v393