Contracts

Deploy a contract from a signer (contract creation tx)

signs a contract-creation transaction (to: null + data: bytecode) and broadcasts it to the chain. Mirrors POST /contracts/v1/call (same auth, lifecycle gating, idempotency, billing) but instead of calling an existing contract, it creates a new one. The bytecode field is the full creation calldata — creation bytecode concatenated with ABI-encoded constructor args (the caller does the encoding using viem/ethers or equivalent; run402 does not compile Solidity). The deterministic CREATE address is computed from (wallet.address, nonce) and returned synchronously in the 202 response, so callers know where the new contract will live before the tx confirms. The reconciler verifies the receipt's contractAddress against the pre-stored predicted address on confirmation. Cost: chain gas at-cost (paid from wallet's native ETH) + $0.000005 signing fee per deploy (same as a regular contract call).

post/contracts/v1/deploy

Request

  • Base URL: https://api.run402.com
  • URL: https://api.run402.com/contracts/v1/deploy
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Request body

signer_idstring required

The cwlt_… ID of a signer owned by the calling project.

chainstring required

Must match the wallet's chain; mismatch returns 400 chain_mismatch.

bytecodestring required

Full creation calldata as 0x-prefixed hex (creation bytecode + ABI-encoded constructor args, concatenated client-side). Must be non-empty, even-length, and ≤ 128 KB (262144 hex chars).

valuestring

Optional native-token value in wei to attach to the deploy (rarely non-zero). Legacy alias for value_wei.

value_weistring

Optional native-token value in wei to attach to the deploy.

Response

Submitted; returns { call_id, tx_hash, status: 'pending', contract_address }. The contract_address is the deterministic CREATE address — known synchronously, before the tx confirms.

call_idstring required
tx_hashstring required
status'pending' | 'confirmed' | 'failed' required
contract_addressstring required

Deterministic CREATE address derived from (wallet.address, nonce). Verified against the on-chain receipt on confirmation.

Changes

No recorded changes to this operation across all 1 revision of this API.