> ## Documentation Index
> Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# EVM Gas Sponsorship

> Sponsor EVM transaction fees for your users with Dynamic's built-in gas sponsorship feature.

> [!NOTE]
>
> EVM Gas Sponsorship on testnets is available on every plan. Sponsoring mainnet transactions requires an Enterprise plan. [Contact us](https://www.dynamic.xyz/talk-to-us) to learn more about upgrading your plan.

Normally, a user needs to hold some of a network's native token (like ETH) to pay the "gas" fee on every transaction. **Gas sponsorship** lets your app pay those fees instead, so users can transact without ever topping up a wallet.

> [!NOTE]
>
> EVM Gas Sponsorship works only with **V3 MPC embedded wallets** (the wallets Dynamic creates for your users). It does not work with external wallets like MetaMask.

## Quick start

**1. Turn on gas sponsorship in the developer console**

1. Go to the [Dynamic Developer Console](https://console.dynamic.xyz)
2. Navigate to **Settings** > **Embedded Wallets**
3. Make sure the EVM chains you want to sponsor are enabled
4. Toggle on **EVM Gas Sponsorship**, then choose which of the [supported networks](https://www.dynamic.xyz/docs/embedded-wallets/gas-sponsorship.md#supported-chains) to sponsor

**2. Send a sponsored transaction**

Call `sendSponsoredTransaction` on the SDK's `evm` module with a list of `EvmSponsoredCall` entries and the user's wallet. It returns the relayed transaction hash.

```kotlin theme={"system"}
import com.dynamic.sdk.android.DynamicSDK
import com.dynamic.sdk.android.Models.BaseWallet
import com.dynamic.sdk.android.Models.EvmSponsoredCall

val sdk = DynamicSDK.getInstance()

suspend fun sendSponsoredTx(
    wallet: BaseWallet,
    recipientAddress: String
): String {
    return sdk.evm.sendSponsoredTransaction(
        calls = listOf(
            EvmSponsoredCall(
                target = recipientAddress,
                data = "0x",                  // "0x" = a plain native-token transfer
                value = "10000000000000000"   // 0.01 ETH in wei
            )
        ),
        wallet = wallet
    )
}
```

The user pays no gas, and the first sponsored transaction handles the one-time EIP-7702 delegation setup automatically.

## What goes in `calls`

Each `EvmSponsoredCall` describes one action the transaction performs:

| Field | Type | Description |
| - | - | - |
| `target` | `String` | The address you are sending to (a recipient or a contract). |
| `data` | `String` | The ABI-encoded action to run on the target. Use `"0x"` for a plain native-token transfer. |
| `value` | `String` | Amount of native token to send with the call, in wei as a decimal string. Use `"0"` when the call moves no native token. |

## Batch calls

A single sponsored transaction can carry more than one call: they are executed together, atomically (all succeed or all revert). The example below approves an ERC-20 spend and deposits into a contract in one sponsored transaction:

```kotlin theme={"system"}
import java.math.BigInteger

suspend fun approveAndDeposit(
    wallet: BaseWallet,
    tokenAddress: String,
    spenderAddress: String,
    amount: BigInteger
): String {
    return sdk.evm.sendSponsoredTransaction(
        calls = listOf(
            EvmSponsoredCall(
                target = tokenAddress,
                data = Erc20.encodeApprove(spenderAddress, amount),
                value = "0"
            ),
            EvmSponsoredCall(
                target = spenderAddress,
                data = "0x...", // encoded vault call
                value = "0"
            )
        ),
        wallet = wallet
    )
}
```

`Erc20.encodeApprove` builds the calldata for the ERC-20 `approve(address,uint256)` function. `Erc20.encodeAllowance` builds the `allowance(address,address)` calldata, and `sdk.evm.erc20Allowance(token, owner, spender, chainId)` reads the current allowance on-chain when you want to skip an approval the wallet already granted.

## Check sponsorship availability

`isGasSponsorshipEnabled` reports whether the environment can sponsor for the current wallet. Use it before building a sponsored flow, and keep a wallet-paid path for when it returns `false`:

```kotlin theme={"system"}
if (sdk.evm.isGasSponsorshipEnabled()) {
    sdk.evm.sendSponsoredTransaction(calls = calls, wallet = wallet)
} else {
    // Fall back to a regular sendTransaction
}
```

## Earn integration

When [Earn](https://www.dynamic.xyz/docs/kotlin/earn.md) executes an EVM vault action, its `sponsored` parameter routes the approval and the vault call through gas sponsorship automatically. See [Gas sponsorship](https://www.dynamic.xyz/docs/kotlin/earn.md#gas-sponsorship) in the Earn guide.

## What's Next

* [SVM Gas Sponsorship](https://www.dynamic.xyz/docs/kotlin/wallets/solana/svm-gas-sponsorship.md) - Sponsor Solana transaction fees
* [Earn](https://www.dynamic.xyz/docs/kotlin/earn.md) - Deposit into yield vaults with sponsored execution
* [Send ETH](https://www.dynamic.xyz/docs/kotlin/wallets/evm/send-eth.md) - Wallet-paid EVM transactions


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.