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 { 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 });

// Subscribe to CreatedFailed events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("EVM") &&
      event.method === "CreatedFailed"
    )
    .forEach(({ event }) => {
      console.log("CreatedFailed:", event.data.toHuman());
    });
});

Runtime Info

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