wagmi-write-contract

Write to Ethereum contracts and send transactions using wagmi's writeContract API.

Updated Nov 5, 2025
One-click install
npx skills add https://github.com/cyotee/crane --skill wagmi-write-contract
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wagmi-write-contract
Source: https://github.com/cyotee/crane/tree/main/.claude/skills/wagmi-write-contract
Command: npx skills add https://github.com/cyotee/crane --skill wagmi-write-contract

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing transactions to contracts and calling state-changing functions can be error-prone and verbose. This skill provides a streamlined interface to perform writes, with validation and optional gas controls.

Core Features & Use Cases

  • Write to contracts: execute nonpayable/state-changing functions.
  • Simulate before write: preview transactions and validation before sending.
  • Chain validation and gas options: configure gas settings and target networks.

Quick Start

Run a simple writeContract call to invoke a contract function and receive the transaction hash.

Frequently Asked Questions about wagmi-write-contract

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write to an Ethereum contract using wagmi?

To write to an Ethereum contract using wagmi, use the writeContract API to execute state-changing functions and receive a transaction hash. It handles abi-based function calls, address handling, and value handling.

Can I simulate an Ethereum contract transaction before sending it?

Yes, you can simulate an Ethereum contract transaction before sending it to preview and validate the interaction. This allows you to check for errors and confirm expected outcomes before committing gas.

How do I configure gas settings and validate chains for wagmi contract writes?

You can configure gas settings and validate target networks by passing optional chain constraints within the writeContract call. This ensures your contract interaction targets the correct blockchain network with appropriate gas limits.

What do I need to call state-changing functions on Ethereum with wagmi?

To call state-changing functions on Ethereum with wagmi, you need the contract's abi, the target contract address, and optional account constraints. The writeContract API uses these to format and send the transaction.

Why does my wagmi contract write fail on the wrong network?

Wagmi contract writes fail on the wrong network because chain validation ensures the transaction targets the specified blockchain. You must configure optional chain constraints to enforce execution on the correct Ethereum network.