CreatedFailed

Event v210 → current #2

Emitted when contract creation fails during execution.

View events on chain
Useful for: developers

The Big Picture

Deployment failures indicate constructor reverts, gas issues, or invalid bytecode. Use transaction traces to debug.

Use Cases

  • Debug failed deployments
  • Monitor success rates

From Chain Metadata

A contract was attempted to be created, but the execution failed.

Triggers

Emitted by

Preconditions

  • Creation attempted
  • Execution error occurred

Effects

Postconditions

  • No code stored
  • Gas consumed to failure point

Side Effects

  • State changes reverted

Event Data

#NameTypeDescription
0
address
→ intended_address
H160 Address where contract would have been deployed (H160)

Code Examples

import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to CreatedFailed events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.EVM.CreatedFailed.get(block.hash);
  for (const evt of events) {
    console.log("CreatedFailed:", evt.payload);
  }
});

Runtime Info

Pallet Index
22
Event Index
2
First Version
v210
Current Version
v411