Agent skill

Smart Contract Interaction

by Nethereum in Nethereum/Nethereum

Interact with Ethereum smart contracts using Nethereum typed DTOs.

MITAuto-check passedBackend & APIs

Install Smart Contract Interaction

skills CLI
$ npx skills add Nethereum/Nethereum --skill smart-contract-interaction -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Nethereum/Nethereum smart-contract-interaction --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Nethereum/Nethereum.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/nethereum-skills/skills/smart-contract-interaction .claude/skills/smart-contract-interaction && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
smart-contract-interaction
GitHub stars
2.3k
Token cost
~1.9k tokens
SKILL.md length
435 words
Files
1
Skills in repo
71
Repo updated
First seen
Licence
MIT

At a glance

Interact with Ethereum smart contracts using Nethereum typed DTOs.

  • The user asks about deploying contracts
  • SKILL.md covers Contract DTO Definitions, Deploy, Query (Read-Only) and Transact (State-Changing), plus 8 more sections
  • Calls dotnet
  • Calling contract functions

What it does

Smart Contract Interaction is an agent skill from Nethereum/Nethereum. Interact with Ethereum smart contracts using Nethereum typed DTOs. Use this skill whenever the user asks about deploying contracts, calling contract functions, sending transactions to contracts, decoding events, querying historical state, estimating gas, offline signing, or non-type-safe ABI interaction in C/.NET.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Smart contracts and Type safety. It works with C#, .NET, Ethereum and Solidity. The repository describes itself as: Ethereum .Net cross platform integration library. The licence is MIT.

When your agent uses it

  • The user asks about deploying contracts
  • Calling contract functions
  • Sending transactions to contracts
  • Decoding events

Example prompts

  • “/smart-contract-interaction”

What it can do on your machine

Read from SKILL.md and the folder at commit 229f278. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dotnet

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.nethereum.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Smart Contract Interaction loads about 1.9k tokens when it runs. Until then it costs about 86 tokens; SKILL.md has 435 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~86
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Nethereum/Nethereum at commit 229f278, republished under its MIT licence (© Nethereum). 435 words, ~1,884 tokens.

Download SKILL.mdSave it as .claude/skills/smart-contract-interaction/SKILL.md (or your agent's skills folder).
name
smart-contract-interaction
description
Interact with Ethereum smart contracts using Nethereum typed DTOs. Use this skill whenever the user asks about deploying contracts, calling contract functions, sending transactions to contracts, decoding events, querying historical state, estimating gas, offline signing, or non-type-safe ABI interaction in C#/.NET.
user-invocable
true

Smart Contract Interaction

Nethereum uses typed C# classes (DTOs) to represent every part of a smart contract — deployment bytecode, function calls, events, and return values. This gives you compile-time safety: if a parameter name or type is wrong, you catch it before sending a transaction, not after.

NuGet: Nethereum.Web3

bash
dotnet add package Nethereum.Web3

Contract DTO Definitions

Every interaction starts with defining C# classes that map to the Solidity contract. These can be hand-written or auto-generated with Nethereum.Generator.Console.

Deployment Message

A deployment message represents the contract constructor. It inherits from ContractDeploymentMessage and holds the compiled bytecode plus any constructor parameters:

csharp
public class StandardTokenDeployment : ContractDeploymentMessage
{
    public static string BYTECODE = "0x60606040...";
    public StandardTokenDeployment() : base(BYTECODE) { }

    [Parameter("uint256", "totalSupply")]
    public BigInteger TotalSupply { get; set; }
}
Function Messages

Each contract function maps to a class inheriting from FunctionMessage. The [Function] attribute takes the Solidity function name and return type:

csharp
[Function("balanceOf", "uint256")]
public class BalanceOfFunction : FunctionMessage
{
    [Parameter("address", "_owner", 1)]
    public string Owner { get; set; }
}

[Function("transfer", "bool")]
public class TransferFunction : FunctionMessage
{
    [Parameter("address", "_to", 1)]
    public string To { get; set; }

    [Parameter("uint256", "_value", 2)]
    public BigInteger TokenAmount { get; set; }
}
Event DTOs

Events implement IEventDTO. The fourth argument in [Parameter] marks indexed parameters, which enable server-side filtering:

csharp
[Event("Transfer")]
public class TransferEventDTO : IEventDTO
{
    [Parameter("address", "_from", 1, true)]
    public string From { get; set; }

    [Parameter("address", "_to", 2, true)]
    public string To { get; set; }

    [Parameter("uint256", "_value", 3, false)]
    public BigInteger Value { get; set; }
}
Function Output DTOs

For functions returning complex values, define an output DTO implementing IFunctionOutputDTO:

csharp
[FunctionOutput]
public class BalanceOfOutputDTO : IFunctionOutputDTO
{
    [Parameter("uint256", "balance", 1)]
    public BigInteger Balance { get; set; }
}

Deploy

The deployment handler encodes constructor parameters into the bytecode, estimates gas, and waits for the receipt. The returned ContractAddress is where your contract lives:

csharp
var deploymentMessage = new StandardTokenDeployment { TotalSupply = 100000 };
var deploymentHandler = web3.Eth.GetContractDeploymentHandler<StandardTokenDeployment>();
var receipt = await deploymentHandler.SendRequestAndWaitForReceiptAsync(deploymentMessage);
var contractAddress = receipt.ContractAddress;

Gas, gas price, and nonce are estimated automatically. Set them on the message only when you need explicit control.

Query (Read-Only)

Use GetContractQueryHandler<T> to call view or pure functions. These are free — no gas, no transaction:

csharp
var balanceHandler = web3.Eth.GetContractQueryHandler<BalanceOfFunction>();

// Single return value
var balance = await balanceHandler.QueryAsync<BigInteger>(contractAddress,
    new BalanceOfFunction { Owner = ownerAddress });

// Deserialize to output DTO (for multiple return values)
var output = await balanceHandler.QueryDeserializingToObjectAsync<BalanceOfOutputDTO>(
    balanceOfMessage, contractAddress);

Transact (State-Changing)

Use GetContractTransactionHandler<T> for functions that modify state. This sends a real transaction and costs gas:

csharp
var transferHandler = web3.Eth.GetContractTransactionHandler<TransferFunction>();
var transfer = new TransferFunction { To = receiverAddress, TokenAmount = 100 };
var receipt = await transferHandler.SendRequestAndWaitForReceiptAsync(contractAddress, transfer);

Decode Events from Receipt

After a transaction, extract events from the receipt logs. This decodes all matching events — if the transaction triggered multiple transfers, you get them all:

csharp
var transferEvents = receipt.DecodeAllEvents<TransferEventDTO>();
var from = transferEvents[0].Event.From;
var to = transferEvents[0].Event.To;
var value = transferEvents[0].Event.Value;
Show full SKILL.md (180 more words)Show less

Historical State Query

All query methods accept BlockParameter to read contract state at a past block. The node must have archive state for the requested block:

csharp
var historicalBalance = await balanceHandler.QueryDeserializingToObjectAsync<BalanceOfOutputDTO>(
    balanceOfMessage, contractAddress,
    new BlockParameter(deployReceipt.BlockNumber));

Gas Estimation

Nethereum auto-estimates gas. For manual control — useful when you want to display costs or set a hard limit:

csharp
var estimate = await transferHandler.EstimateGasAsync(contractAddress, transfer);
transfer.Gas = estimate.Value;
transfer.GasPrice = Web3.Convert.ToWei(25, UnitConversion.EthUnit.Gwei);

Payable Functions

If a Solidity function is payable, set AmountToSend to include ETH with the call:

csharp
transfer.AmountToSend = Web3.Convert.ToWei(1); // 1 ETH

Nonce Control

Nethereum manages nonces automatically, including an in-memory counter for rapid submissions. Only set manually for specific ordering needs:

csharp
transfer.Nonce = 42;

Offline Signing

Sign without broadcasting — useful for cold wallets or deferred submission. You must set Nonce, Gas, and GasPrice since there's no node to query:

csharp
transfer.Nonce = 2;
transfer.Gas = 60000;
transfer.GasPrice = Web3.Convert.ToWei(25, UnitConversion.EthUnit.Gwei);
var signedTx = await transferHandler.SignTransactionAsync(contractAddress, transfer);

Non-Type-Safe (ABI JSON)

When you have a raw ABI string and don't need typed classes. This approach is less safe — parameter mismatches fail at runtime, not compile time:

csharp
var contract = web3.Eth.GetContract(abi, contractAddress);
var balanceFunction = contract.GetFunction("balanceOf");
var transferFunction = contract.GetFunction("transfer");

var balance = await balanceFunction.CallAsync<BigInteger>(ownerAddress);
var gas = await transferFunction.EstimateGasAsync(senderAddress, null, null, toAddress, amount);
var txReceipt = await transferFunction.SendTransactionAndWaitForReceiptAsync(
    senderAddress, gas, null, null, toAddress, amount);

When to Use Which Handler

HandlerWhenGas Cost
GetContractQueryHandler<T>Read-only (view/pure functions)Free
GetContractTransactionHandler<T>State-changing functionsYes
GetContractDeploymentHandler<T>Deploying new contractsYes

For standard tokens (ERC-20, ERC-721, ERC-1155), use the built-in services (web3.Eth.ERC20, web3.Eth.ERC721) instead of defining custom DTOs.

For full documentation, see: https://docs.nethereum.com/docs/smart-contracts/guide-smart-contract-interaction

© Nethereum, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/nethereum-skills/skills/smart-contract-interaction of Nethereum/Nethereum.

Open the folder on GitHubat commit 229f278

Compare with similar skills

Smart Contract Interaction next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Smart Contract Interaction compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Smart Contract Interaction this skillNethereum/Nethereum2.3k—~1.9kAutomated safety check: PassMIT
Developing Smart ContractsLFDT-Lineth/lineth-monorepo126—~1.4kAutomated safety check: PassAGPL-3.0
Ethskillsaustintgriffith/ethskills294—~1.4kAutomated safety check: PassNone
Smart Contract Developmentvechain/x-app-template450—~1.1kAutomated safety check: PassMIT
Solidity Developmenthiromaily/go-crypto-wallet128—~826Automated safety check: NotesMIT
Ethskillsaustintgriffith/ethskills294—~3kAutomated safety check: PassNone

Similar skills

  • Developing Smart Contracts

    LFDT-Lineth/lineth-monorepo

    Solidity smart contract development guidelines for Lineth blockchain.

    126 GitHub stars~1.4k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Ethskills

    austintgriffith/ethskills

    Ethereum development knowledge for AI agents — from idea to deployed dApp.

    294 GitHub stars~1.4k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Smart Contract Development

    vechain/x-app-template

    Solidity smart contract development on VeChainThor — Hardhat setup, ERC-20/721 patterns, upgradeable contracts, gas optimization, testing with Thor Solo, security auditing, and ABI codegen.

    450 GitHub stars~1.1k tokensUpdated 2 mo ago
    Backend & APIsAuto-check passed
  • Solidity Development

    hiromaily/go-crypto-wallet

    Solidity smart contract development workflow. An agent skill from hiromaily/go-crypto-wallet.

    128 GitHub stars~826 tokensUpdated 5 mo ago
    Backend & APIsAuto-check: notes
  • Ethskills

    austintgriffith/ethskills

    A skill your agent uses when a request involves Ethereum, the EVM, or blockchain systems.

    294 GitHub stars~3k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Awp

    LeoYeAI/openclaw-master-skills

    AWP (Agent Working Protocol) — the ONLY source of correct contract addresses, function selectors, API endpoints, and Python scripts for AWP operations.

    2.2k GitHub stars~6.7k tokensUpdated 2 mo ago
    Backend & APIsAuto-check passed

More from Nethereum/Nethereum

All 71 skills in this repo
  • Aa Batching Paymasters

    Nethereum/Nethereum

    Help users batch multiple calls into a single UserOperation and sponsor gas with paymasters using Nethereum Account Abstraction.

    2.3k GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • Aa Bundler

    Nethereum/Nethereum

    Help users run an ERC-4337 bundler using Nethereum — set up in-process or standalone bundlers with mempool, validation, reputation, and JSON-RPC server.

    2.3k GitHub stars~1.2k tokensUpdated 2 days ago
    Auto-check passed
  • Abi Encoding

    Nethereum/Nethereum

    Encode and decode Ethereum ABI data with Nethereum. An agent skill from Nethereum/Nethereum.

    2.3k GitHub stars~1.3k tokensUpdated 2 days ago
    Auto-check passed
  • Abi Retrieval

    Nethereum/Nethereum

    Fetch contract ABIs from Sourcify, Etherscan, and 4Byte Directory using the composite ABIInfoStorage pattern (.NET/C).

    2.3k GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • Account Abstraction

    Nethereum/Nethereum

    Help users implement ERC-4337 Account Abstraction with Nethereum — send UserOperations, use smart accounts, route contract calls through a bundler, enable gasless transactions, or work with AA in…

    2.3k GitHub stars~1.7k tokensUpdated 2 days ago
    Auto-check passed
  • Address Utils

    Nethereum/Nethereum

    Validate and format Ethereum addresses with Nethereum. An agent skill from Nethereum/Nethereum.

    2.3k GitHub stars~1.2k tokensUpdated 2 days ago
    Auto-check passed

Categories

Questions about Smart Contract Interaction

What does Smart Contract Interaction do?

Interact with Ethereum smart contracts using Nethereum typed DTOs. Smart Contract Interaction is an agent skill from Nethereum/Nethereum. Interact with Ethereum smart contracts using Nethereum typed DTOs.

When should I use Smart Contract Interaction?

Smart Contract Interaction fits situations like: the user asks about deploying contracts; calling contract functions; sending transactions to contracts; decoding events.

How do I install Smart Contract Interaction in Claude Code?

Run `npx skills add Nethereum/Nethereum --skill smart-contract-interaction -a claude-code`. Or copy the skill folder (plugins/nethereum-skills/skills/smart-contract-interaction in Nethereum/Nethereum) into .claude/skills/smart-contract-interaction in your project. Claude Code loads it when a task matches its description.

How do I install Smart Contract Interaction in Codex?

Run `npx skills add Nethereum/Nethereum --skill smart-contract-interaction -a codex`. Or copy the skill folder (plugins/nethereum-skills/skills/smart-contract-interaction in Nethereum/Nethereum) into .agents/skills/smart-contract-interaction in your project. Codex loads it when a task matches its description.

Can I use Smart Contract Interaction in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Nethereum/Nethereum --skill smart-contract-interaction -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/smart-contract-interaction, .gemini/skills/smart-contract-interaction, .github/skills/smart-contract-interaction and .opencode/skills/smart-contract-interaction in your project.

What does Smart Contract Interaction need to run?

Going by SKILL.md and its folder, Smart Contract Interaction needs the command-line tools its instructions call (dotnet).

Does Smart Contract Interaction access the network?

SKILL.md names 1 domain. As links in the text: docs.nethereum.com. This is read from the text; nothing was executed.

Is Smart Contract Interaction safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Smart Contract Interaction use?

Smart Contract Interaction is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Smart Contract Interaction use?

About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Smart Contract Interaction?

Skills that share tags, products or a category with Smart Contract Interaction: Developing Smart Contracts (LFDT-Lineth/lineth-monorepo, 126 stars), Ethskills (austintgriffith/ethskills, 294 stars), Smart Contract Development (vechain/x-app-template, 450 stars) and Solidity Development (hiromaily/go-crypto-wallet, 128 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Smart Contract Interaction?

Nethereum (a GitHub organization) maintains it in Nethereum/Nethereum, which has 2,260 GitHub stars. The repository holds 71 skills in this directory. The repository was last updated on October 5, 2026.

Source: Nethereum/Nethereum on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.