> For the complete documentation index, see [llms.txt](https://docs-sdk.crypto-chief.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-sdk.crypto-chief.com/processing/java/guides/contract-calls.md).

# Contract calls (EVM / TRON)

Call EVM, TRON, and Solana contracts in Java without hand-encoding calldata.

Most real-world transactions are smart-contract calls. You never encode the `data` field by hand: give the SDK a typed description and get back a signed reservation.

{% hint style="warning" %}
Contract-type transactions (`signEvmCall`, `erc20Transfer`, `signTronCall`, `signAnchorCall` — every helper in this guide signs `type=contract`) are covered by the same [execute-time pre-flight](/processing/java/guides/sign-execute.md): a wallet without enough native coin for gas gets `PREFLIGHT_FAILED` instead of an on-chain revert or a silent gas burn. On TRON, the call is additionally simulated, so a reverting call (including an insufficient token balance) is rejected as `simulation_reverted` before any fee is spent.
{% endhint %}

## EVM — by Solidity signature

{% hint style="danger" %}
This snippet shows the **encoder**, not a complete swap. Two things have to be true before a swap like this succeeds on chain:

* **An allowance.** Uniswap's router moves your input token with `transferFrom`, so it needs an ERC-20 `approve(address,uint256)` on that token first, confirmed before the swap is signed — the nonce comes from chain state. Without it the swap reverts and burns the gas.
* **A slippage floor.** `amountOutMin` of `0` accepts whatever the pool returns, which on a public mempool hands the trade to the first sandwich bot that sees it. Pass a real minimum, in the output token's base units.
  {% endhint %}

```java
import com.cryptochief.processing.Amount;
import com.cryptochief.processing.Chain;
import java.math.BigInteger;
import java.util.List;

BigInteger amountIn  = Amount.toBase("0.01", 18);
BigInteger amountMin = BigInteger.ZERO;

var signed = client.transactions().signEvmCall(
    Chain.ETH_MAINNET,
    "0xYourWallet...",
    "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D", // Uniswap V2 router
    "swapExactTokensForTokens(uint256,uint256,address[],address,uint256)",
    List.of(amountIn, amountMin, List.of(tokenIn, tokenOut), "0xYou...", deadline),
    "0",
    "https://your.app/webhooks/transaction");
```

The encoder supports `uint/int<M>`, `address`, `bool`, `bytes`, `bytes<N>`, `string`, and fixed/dynamic arrays of those. Argument values accept `BigInteger`, `Integer`/`Long`, decimal/hex strings, `byte[]`, and `List<?>`.

## ERC-20 / TRC-20 transfer (one-liner)

```java
BigInteger amount = Amount.toBase("12.5", 6); // USDT has 6 decimals

client.transactions().erc20Transfer(
    Chain.ETH_MAINNET,
    "0xYourWallet...",
    "0xdAC17F958D2ee523a2206206994597C13D831ec7",
    "0xRecipient...",
    amount);
```

## TRON — same encoder, base58 addresses

`signTronCall` (an alias of `signEvmCall`) accepts both base58 (`T...`) and `0x41`-prefixed hex addresses:

```java
client.transactions().signTronCall(
    Chain.TRON_MAINNET,
    "TYourWallet...",
    "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", // USDT TRC-20
    "transfer(address,uint256)",
    List.of("TRecipient...", amount),
    "0",
    null);
```

## Solana — Anchor program

```java
import com.cryptochief.processing.models.SolanaAccount;
import com.cryptochief.processing.solana.Borsh;
import java.util.List;

var signed = client.transactions().signAnchorCall(
    Chain.SOLANA_MAINNET,
    "YourWallet...",
    "YourProgramId...",
    "initialize",
    List.of(Borsh.u64(1_000_000L), Borsh.string("hello")),
    List.of(new SolanaAccount("YourWallet...", true, true)),
    null);
```

For non-Anchor Solana programs, use `signSolanaCall` with raw instruction bytes. For TON contracts, see [TON transfers](/processing/java/guides/ton.md).
