# What is Zyfi?

[Zyfi](https://www.zyfi.org/) is a native Account Abstraction provider focused on flexibility and ease of integration.&#x20;

Zyfi was created to accelerate adoption by providing the best on-chain UX for ZKsync and Elastic Chains, leveraging [Native Account Abstraction](https://docs.zksync.io/build/developer-reference/account-abstraction).&#x20;

The main focus of Zyfi revolves around paymasters and the features they offer. From allowing users to pay with any ERC-20 token (currently more than 80) enabling specific sponsorship logic with [Sybil prevention](/integration-guide/paymaster-sybil-defense) and dashboard analytics, Zyfi helps deliver the best gas abstraction experience for users and Dapps.\
\
All is powered by an [API](/integration-guide/paymasters-integration) that takes less than a day to implement, abstracting the complexities away from protocols so they can focus on building their products. Zyfi has processed over [1.5M](https://dune.com/zyfi/zyfi-usage-overview) paymaster transactions and is integrated with more than [30 DApps](https://x.com/Zyfi_org/status/1836070225474949571) on ZK chains across various sectors, including PancakeSwap (DEX), ZeroLend (Supply & Borrow), SyncSwap (DEX), Gravita (CDP), Increment Fi (Perp), and zkMarkets (NFT marketplace), with many more in the pipeline.

Beyond the paymaster service, Zyfi offers a [gasless portal](https://www.zyfi.org/) where users can experience the power of native AA: they can swap at the best rates, send tokens without having ETH, or submit custom paymaster transactions to interact with protocols that don’t yet offer a paymaster solution.

## Gas Management Challenge

Managing gas has always been a challenge, especially when users try to execute a complex transaction only to discover they have no gas tokens left.&#x20;

New users often get confused about why native gas tokens are needed and how to acquire them, leading to wasted time and scattered funds across multiple wallets.&#x20;

## Smart Wallets

Smart Wallets provide a strong solution to this challenge. Pushed by [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337), these advanced smart contract accounts create transactions using a completely different architecture and transaction flow. Transactions, or UserOps, use a distinct transaction mempool and bundlers to build blocks, with the ability to interact with paymaster contracts for gasless transactions.\
\
However, a key limitation remains: **Externally Owned Accounts (**[**EOA**](https://ethereum.org/en/developers/docs/accounts/)**s) cannot interact with paymasters in the ERC-4337 architecture**. This is due to the fact that Account Abstraction was never implemented at the core protocol layer of existing chains. Introducing native AA at this level would require substantial modifications to these chains, and such changes are not currently planned.

<figure><img src="/files/s7PGZaI4qg4yGyLrehyh" alt=""><figcaption><p>Ethereum Mainnet and other EVM L2s without native AA</p></figcaption></figure>

## ZKsync's native Account Abstraction

ZKsync is the first EVM-compatible Layer 2 to support Account Abstraction at the core protocol level. **On ZKsync and ZK chains, all accounts are smart wallets by default.**&#x20;

When an EOA initiates a transaction on native AA chains, a `DefaultAccount` contract is used to simulate the behavior of an EOA. From the user's perspective, they are using a smart wallet that acts as an EOA. This enables EOAs to send transactions gaslessly with paymasters on all ZK chains through any wallet (e.g., MetaMask, TrustWallet, Rabby).

> “Accounts in ZKsync Era can initiate transactions, like an EOA, but can also have arbitrary logic implemented in them, like a smart contract. This feature, called "account abstraction" (AA), aims to resolve the issues described above.” - ZKsync [documentation](https://docs.zksync.io/build/developer-reference/account-abstraction)

<figure><img src="/files/wCnuaIq1dYcjljlSKNhv" alt=""><figcaption><p>Native AA on ZK chains</p></figcaption></figure>

**This is why at Zyfi, we’ve developed tools and gas abstraction solutions across all ZK chains that support native Account Abstraction.**

## Zyfi - Generalized Gasless Transactions

**Below is how Zyfi's paymaster tool enable an EOA to perform transactions gaslessly.**

<figure><img src="/files/wrHKfTBr5NJdu4MvHJ9R" alt=""><figcaption><p>Zyfi provide gasless experiences</p></figcaption></figure>

The Zyfi paymaster API allows any DApp to offer gasless transactions and lets users pay for gas with any ERC-20 token they hold.

The whole process is built with 3 major steps:

1. **The paymaster API interacts directly with any front end.** It receives the transaction data and adds the paymaster parameters, including the fee token (ERC-20) used to cover gas costs or any custom sponsorship logic applied by the Dapp.
2. **User signing transaction data.** The user then signs a gasless transaction and gives the allowance to the paymaster for the ERC-20 fee.&#x20;
3. **Paymaster execution.** The Zyfi Paymaster then receives the ERC-20 fee to validate and execute the transaction while paying the ETH gas fees for the end user.


# Paymaster Flow

Understanding each phase

The flow of the paymaster enables a smooth process for users to be able to swap without the need for gas. The following process is completely trustless and can enable a user to pay with any ERC-20 token or get his transaction sponsored. Let's break down in detail the whole process into 3 steps.

<figure><img src="/files/EST9GSeMyLQxRdITWAkx" alt=""><figcaption><p>Full Paymaster Flow</p></figcaption></figure>

### 1. Fetching the **transaction data from the front end**

Our API can be integrated into any front-end for whatever type of transactions whether it's a DEX, NFT marketplace, DeFi protocol, or a gaming dApp. When connected to the front-end, the API retrieves user-requested transaction data. Zyfi then estimates the gas fee on zkSync's network and fetches off-chain the ERC-20 token price chosen by the user for gas payment.&#x20;

The API subsequently completes the transaction data, incorporating the ERC-20 token fee to cover gas costs, and signs a message for the transaction to be accepted by the paymaster. The filled transaction data is sent back to the front-end ready for user approval.

### 2. User signing the reconstructed transaction&#x20;

The front-end then submits the transaction as normal to the user. The user then reviews the details and signs an off-chain transaction containing the updated transaction data. This data grants the paymaster the ERC-20 fee allowance and authorization to engage with Zyfi's paymaster. The possibilities for the transaction are virtually limitless, as long as the user possesses enough of the ERC-20 token to cover the gas fees.

### 3. Transaction Execution

The Zyfi paymaster then receives the transaction data associated with the signature of the user approving the signed transaction data. Zyfi then receives the ERC-20 fee, validates & executes the transaction by paying the gas needed for the transaction.\
\
If you have any questions regarding the flow don't hesitate to contact the team on [Telegram](https://t.me/joinchat/3-fAd9pmy9gwODlk) or [Discord](https://discord.com/invite/KHchZXmv8Q)&#x20;

**If you wish to use the API in your front-end, you can check our documentation:**  [**https://api.zyfi.org/api-doc**](https://api.zyfi.org/api-doc)


# Gas Grants Program

A new Gas Grant Program ($50'000) for builders is now available to promote native Account Abstraction across the entire ZKsync ecosystem.

## Context and eligibility

Zyfi has developed a paymaster-as-a-service that is flexible, audited, and easy to integrate for Dapps on the ZKsync Era blockchain. Zyfi have released three main products so far, including the [ERC20 paymaster](/integration-guide/paymasters-integration/erc20-paymaster), the [sponsored paymaster](/integration-guide/paymasters-integration/sponsored-paymaster) and the [permissionless multi-signer paymaster](/permissionless-multi-signer-paymaster/about).

Protocols integrating Zyfi paymaster solutions as their official paymaster will be eligible for this gas grant program. This program is straightforward and aims to distribute $50K USD in gas grants, ranging from $500 to $5,000, to projects that integrate the Zyfi paymaster over the coming weeks. These grants will be allocated on a first-come, first-served basis to any type of project on ZKsync (NFT, DeFi, Gaming…) based on criteria such as:

* Number of users on the Dapp (Minimum 100 unique users per day on the Dapp)
* Number of transactions on the ZKsync Era Network (Minimum 500 transactions per day on ZKsync Era)
* The sponsorship model they want to implement

Ultimately, these grants aim to benefit the community by providing more gas abstraction and gasless transactions for users. This grant program seeks to enhance the overall on-chain user experience and leverage the benefits of native account abstraction technology offered by ZKsync. Paymaster transactions are not just a good add-on but a UX priority—no one in the on-chain ecosystem should have to worry about "gas fees."

To apply for these grants, please fill out this Google form: <https://forms.gle/H1n6hKLwwsRtJus97>

### Why Integrate Zyfi's Paymaster Solution?

Zyfi offers solutions that allow your users to pay gas fees with any ERC-20 token and satisfy custom sponsorship logic with simple API integration. Here are some reasons to integrate Zyfi's paymasters:

* **Easy to integrate:** The three different solutions developed by Zyfi are designed to be simple to implement. All tutorials are available in the documentation, and it typically takes the tech team less than a day to integrate the solution.
* **Expand Your Audience, Boost Engagement, Retention, and Volume:** The flexibility in gas fee payments and fee sponsorships contribute directly to higher transaction volumes and sustained user engagement. Native AA on zkSync is designed to appeal to a broad user base.
* **Join a Rewarding Ecosystem:** The Gas Grant Program not only incentivizes Dapps but also rewards users with gas-free transactions.
* **Transparent Fee Structure:** Zyfi currently charges no fees on their paymasters contracts. The precise paymaster allowance system optimizes gas expenditures and builds trust with your users. Gas fee refunds on ZKsync are processed in the same ERC-20 token used for payment.
* **Focus on Security:** Integrating Zyfi ensures a foundation of trust and security with smart contracts that are audited, immutable, and verified. This enhances the overall credibility of your platform and reassures users about the safety of their transactions.


# Quest Dashboard

10% of the total supply will be allocated as rewards for the community with criteria defined by us. The Zyfi Quests Dashboard will be among the premier platforms closely monitored for these rewards.

1 month ago, we officially announced our **Gasless Program** for users and protocols with Gas Points as reward. Today, we are releasing our [**Quests Dashboard**](https://www.zyfi.org/quests) to help you earn more points through social tasks and via our partners where our paymaster is integrated.\
\
**What are Gas Points?**

In our journey towards decentralization, we implemented our own gas points program to recognize **early** and **loyal** users of our paymaster.

Our calculations are quite simple:

**The more gas you spend through our paymaster, the more gas points you earn. ⛽️**\
\
Example: **0.00025 ETH = 100 points**

As you're aware, the gas amount is not related to the volume of your transaction. That's why we can attribute gas points to those who truly use our services **daily** and **recurrently**, rather than to those who make a one-time swap on our frontend and never return.

In a nutshell, these gas points are here to reward **real users** who use our services.

### How does this Quest Dashboard work?&#x20;

This [Quest Dashboard](https://www.zyfi.org/quests) gives you the chance to earn gas points through **3** methods.

* **Through our social tasks.** Following us on Twitter and joining our Discord are one-time tasks that earn you these points. These tasks are very important to us and will be monitored throughout the entire quest dashboard campaign.
* **Use our paymaster in our dApps partners.** Zerolend, Gravita, and Hue NFT are just a few examples of our partners. When you use our paymaster in their apps, you earn gas points.
* **The referral program.** For every friend you refer, you will receive 10% of their points added to your balance. Every referee will also receive an extra 5% of their own points as a bonus.

<figure><img src="/files/GPEPCTG58MQtTgjnhDKa" alt=""><figcaption></figcaption></figure>


# Paymasters Integration

This guide is designed to help you hit the ground running with leveraging the power of ZKsync's native AA.

* The [ERC20 Paymaster guide](/integration-guide/paymasters-integration/erc20-paymaster) shows how to use the endpoint to transform normal transactions in gasless ones, where the user is paying with the desired ERC20 token
* The [Sponsored Paymaster guide](/integration-guide/paymasters-integration/sponsored-paymaster) provides additional information on how to a Dapp can sponsor part or the whole transaction with custom business logic
* The [API Key Management](/integration-guide/paymasters-integration/api-key-management) section helps you understand how the Zyfi API infrastructure works and how to manage it easily.


# ERC20 Paymaster

Available on ZKsync Era mainnet, ZKsync Sepolia, Cronos zkEVM Mainnet, Cronos zkEVM Tesnet, Abstract Tesnet.

This guide will help you get started with the Zyfi API to transform a normal transaction in a paymaster one.

For advanced usage and detailed explanation of each parameter and feature, please explore our detailed [API documentation](https://api.zyfi.org/api-doc).

The basic flow consists of the following steps:

1. Collect the desired transaction payload and the ERC20 the user desires to pay with
2. Send an API request
3. Receive back the quote and transaction payload for the user to sign

## Step 1: Send the API request

Send the required data to the `erc20_paymaster` endpoint. Below an example implementation using Javascript [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) (natively supported in most environments)

<pre class="language-typescript"><code class="lang-typescript">// Define the payload
const payload = {
  chainId: 324, // Optional, defaults to zkSync Era Mainnet; valid options are 324, 300 (ZkSync-Sepolia), 388 (Cronos zkEVM mainnet), 282 (Cronos zkEVM Tesnet) and 11124 (Abstract Testnet).
  feeTokenAddress: // ERC20 the user desires to use as gas token
  txData: {
    from: "0x...",
    to: "0x...",
    data: "0x.."
  }
};

// Define the function to perform the POST request
async function postTransactionData() {
  try {
    const response = await fetch('https://api.zyfi.org/api/erc20_paymaster/v1', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify(payload),
    });

    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }

    const data = await response.json();
    console.log(data); // Process the response data
  } catch (error) {
    console.error('Error during the API call:', error);
  }
}
<strong>
</strong></code></pre>

The returned object does not change the original transaction calldata, but add the paymaster fields necessary to process the transaction.

{% hint style="info" %}
ETH can't be used by the paymaster as feeToken; in this case, the normal transaction flow will proceed.
{% endhint %}

## Step 2: Show the quote to the user

The response, on top of the transaction payload, returns a series of helper values that can  be used by the UI to better inform the user. In particular:

* `tokenAddress` : ERC20 token address used to pay for the gas fee (feeToken)
* `tokenPrice` : the estimated cost of the feeToken
* `feeTokenAmount` : Max amount of the ERC20 token that the user will pay as fee (before refunds). The user need to have this balance for the transaction to not fail
* `feeUSD` : Equivalent value of feeTokenAmount in USD
* `markup` : Markup or discount applied on the gas fee
* `expirationTime` : `block.timestamp` of the quote expiration. Currently it's one hour

{% hint style="info" %}
Transactions on zkSync overestimate the gas needed and receive a refund at the end, which is difficult to know in advance.

The unspent gas is refunded to the user in the feeToken.

We suggest to each protocol to implement their own estimation for the final cost by observing the actual gas being used on their transaction.\
We also provide a very rough estimation with `estimatedFinalFeeTokenAmount` and `estimatedFinalFeeUSD`
{% endhint %}

## Step 3: Execute the transaction&#x20;

{% tabs %}
{% tab title="Ethers" %}
Ensure you are using [zksync-ethers](https://docs.zksync.io/build/sdks/js/getting-started.html#getting-zksync-ethers) V5 or V6.

Below an example implementation with&#x20;

{% code overflow="wrap" %}

```typescript
import { Signer, Web3Provider } from "zksync-ethers";
import * as ethers from "ethers";

const signer = Web3Provider.getSigner

rawTx = Apiresponse.txData

//since the API returns the transaction payload in the ethers format, we can use it as is

txHash = await signer.sendTransaction(rawTx);

```

{% endcode %}
{% endtab %}

{% tab title="Viem" %}
Make sure to check <https://viem.sh/zksync> to enable zkSync specific features

```typescript
import { createWalletClient, custom } from 'viem'
import { zkSync } from 'viem/chains'
import { eip712WalletActions } from 'viem/zksync'
 
const walletClient = createWalletClient({ 
  chain: zkSync, 
  transport: custom(window.ethereum!), 
}).extend(eip712WalletActions()) 

  const nonce = await provider.getTransactionCount({
    address: account!.address,
  });

rawTx = Apiresponse.txData

// We need to reshuffle the response from the api
txPayload = {
      account: account,
      to: rawTx.to,
      value: BigInt(rawTx.value!),
      chain: (signer).chain,
      gas: BigInt(rawTx.gasLimit),
      gasPerPubdata: BigInt(rawTx.customData.gasPerPubdata),
      maxFeePerGas: BigInt(rawTx.maxFeePerGas),
      maxPriorityFeePerGas: BigInt(0),
      data: rawTx.data,
      paymaster: rawTx.customData.paymasterParams.paymaster,
      paymasterInput: rawTx.customData.paymasterParams.paymasterInput,
      nonce,
  }
  const txHash = await walletClient.sendTransaction(txPayload);
```

{% endtab %}
{% endtabs %}


# Sponsored Paymaster

Available on ZKsync Era mainnet, ZKsync Sepolia, Cronos zkEVM Mainnet, Cronos zkEVM Tesnet, Abstract Tesnet, Abstract Mainnet.

This guide will help you get started with Zyfi API sponsored endpoint to allow custom business logic.

In addition to the standard ERC20 Paymaster flow, it allows a protocol to decide how much of the transaction it wishes to sponsor for an user with their off-chain business logic by setting the sponsorshipRatio. What is not sponsored is paid by the user with the selected feeToken

For advanced usage and detailed explanation of each parameter and feature, please explore our detailed [API documentation](https://api.zyfi.org/api-doc).

The basic flow consists of the following steps:

1. Deposit **ETH** in the audited Zyfi Vault contract that will be used to sponsor transactions for your users (Use the [Zyfi Dashboard](https://www.zyfi.org/dashboard) to deposit on the correct address)
2. The deposit transaction generates a corresponding balance in the vault, associated with your wallet address. This balance covers the transaction fees for your users
3. Get an `API-Key` connected to the vault balance (on the [Zyfi Dashboard](https://www.zyfi.org/dashboard))
4. Collect the  transaction payload (similar to the ERC20 Paymaster)
5. Send an API request with the sponsorship information
6. Receive back the quote and transaction payload for the user to sign

{% hint style="info" %}
[Here's a quick demo video](https://youtu.be/AukF_sqCMSc?feature=shared) on how to integrate the Zyfi API on the Abstract Chain.
{% endhint %}

## Step 1: Send the API request

Send the required data to the `erc20_sponsored_paymaster` endpoint. Below an example implementation using Javascript [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) (natively supported in most environments)

<pre class="language-typescript" data-overflow="wrap"><code class="lang-typescript">// Define the payload
const payload = {
  chainId: 324, // Optional, defaults to zkSync Era Mainnet; valid options are 324, 300 (ZkSync-Sepolia), 388 (Cronos zkEVM Mainnet), 282 (Cronos zkEVM Testnet) and 11124 (Abstract Testnet).
  feeTokenAddress: // ERC20 the user desires to use as gas token
  sponsorshipRatio: // [0-100] which % of the transaction is sponsored by the protocol 
  replayLimit: // Optional (default of 5), how many times the user can execute the transaction
  txData: {
    from: "0x...",
    to: "0x...",
    data: "0x.."
  }
};

// Define the function to perform the POST request
async function postTransactionData() {
  try {
    const response = await fetch('https://api.zyfi.org/api/erc20_sponsored_paymaster/v1', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'X-API-Key': '&#x3C;API Key>'
      },
      body: JSON.stringify(payload),
    });

    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }

    const data = await response.json();
    console.log(data); // Process the response data
  } catch (error) {
    console.error('Error during the API call:', error);
  }
}
<strong>
</strong></code></pre>

The returned object does not change the original transaction calldata, but add the paymaster fields necessary to process the transaction.

{% hint style="info" %}
ETH can't be used by the paymaster as feeToken; in this case, the normal transaction flow will proceed.
{% endhint %}

## Step 2: Show the quote to the user

The response, on top of the transaction payload, returns a series of helper values that can  be used by the UI to better inform the user. In particular:

* `tokenAddress` : ERC20 token address used to pay for the gas fee (feeToken)
* `tokenPrice` : the estimated cost of the feeToken
* `feeTokenAmount` : Max amount of the ERC20 token that the user will pay as fee (before refunds). The user need to have this balance for the transaction to not fail
* `feeUSD` : Equivalent value of feeTokenAmount in USD
* `markup` : Markup or discount applied on the gas fee
* `protocolAddress` : The account in the vault being used to pay for the sponsored part
* `sponsorshipRatio` : which % of the transaction is sponsored by the protocol&#x20;
* `expirationTime` : `block.timestamp` of the quote expiration. Currently it's one hour

{% hint style="info" %}
Transactions on zkSync overestimate the gas needed and receive a refund at the end, which is difficult to know in advance.

The unspent gas is refunded to the user in the feeToken.

We suggest to to each protocol to implement their own estimation for the final cost by observing the actual gas being used on their transaction.\
We also provide a very rough estimation with `estimatedFinalFeeTokenAmount` and `estimatedFinalFeeUSD`
{% endhint %}

## Step 3: Execute the transaction&#x20;

{% tabs %}
{% tab title="Ethers" %}
Ensure you are using [zksync-ethers](https://docs.zksync.io/build/sdks/js/getting-started.html#getting-zksync-ethers) V5 or V6.

Below an example implementation with&#x20;

{% code overflow="wrap" %}

```typescript
import { Signer, Web3Provider } from "zksync-ethers";
import * as ethers from "ethers";

const signer = Web3Provider.getSigner

rawTx = Apiresponse.txData

//since the API returns the transaction payload in the ethers format, we can use it as is

txHash = await signer.sendTransaction(rawTx);

```

{% endcode %}
{% endtab %}

{% tab title="Viem" %}
Make sure to check <https://viem.sh/zksync> to enable zkSync specific features

```typescript
import { createWalletClient, custom } from 'viem'
import { zkSync } from 'viem/chains'
import { eip712WalletActions } from 'viem/zksync'
 
const walletClient = createWalletClient({ 
  chain: zkSync, 
  transport: custom(window.ethereum!), 
}).extend(eip712WalletActions()) 

  const nonce = await provider.getTransactionCount({
    address: account!.address,
  });

rawTx = Apiresponse.txData

// We need to reshuffle the response from the api
txPayload = {
      account: account,
      to: rawTx.to,
      value: BigInt(rawTx.value!),
      chain: (signer).chain,
      gas: BigInt(rawTx.gasLimit),
      gasPerPubdata: BigInt(rawTx.customData.gasPerPubdata),
      maxFeePerGas: BigInt(rawTx.maxFeePerGas),
      maxPriorityFeePerGas: BigInt(0),
      data: rawTx.data,
      paymaster: rawTx.customData.paymasterParams.paymaster,
      paymasterInput: rawTx.customData.paymasterParams.paymasterInput,
      nonce,
  }
  const txHash = await walletClient.sendTransaction(txPayload);
```

{% endtab %}
{% endtabs %}


# API Key management

Both API's are linked to the two paymaster contracts, the [ERC20 paymaster](/integration-guide/paymasters-integration/erc20-paymaster) and the [Sponsored Paymaster.](/integration-guide/paymasters-integration/sponsored-paymaster)

## ERC20 Paymaster

As a Dapp, when you send the required data to the `erc20_paymaster` endpoint, you do not need to manage an API key.

## Sponsored Paymaster

As a Dapp, if you want to send the required data to the `erc20_sponsored_paymaster` endpoint, you will need to manage API Key provided by the [Zyfi Dashboard.](https://www.zyfi.org/dashboard)&#x20;

This API Key can be used for both Mainnet and Testnet. Just specify the `isTesnet:True` function in the API call if you want to use the Testnet vault. More details in [API documentation here](https://api.zyfi.org/api-doc/).

To sponsor gas fees for your users, you must deposit **ETH** into a vault contract to sponsor gas.\
In order to deposit ETH into the vault contract, you have two options:

{% hint style="warning" %}
**IMPORTANT:** Never send ERC20 tokens to the vault; only send Native Token(ETH).
{% endhint %}

1. **Send** ETH directly into the vault contract on ZKsync or another supported network from your wallet. Note: **the API Key will be linked to this wallet address.** \
   Here are the vault addresses on ZKsync chains and [here](/support/contract-addresses) for all other chains:\
   ZKsync Mainnet : `0x32faBA244AB815A5cb3E09D55c941464DBe31496`\
   ZKsync Sepolia : `0xbA72A10ce8496DC9C13b9eE8c35fcCD3809d3C81`
2. **Fund** the account from another address:

   * Go to the [vault explorer page](https://explorer.zksync.io/address/0x32faBA244AB815A5cb3E09D55c941464DBe31496#contract)
   * Connect your wallet
   * Click "Write" and "depositToAccount"
   * Enter the payable amount (e.g., 0.1 for 0.1 ETH)
   * Enter the account you want to deposit for (e.g., your wallet depositor address in above point)
   * Click "Write" and send ETH

   ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeEhAGQiQELC5LcC_ewCbrR_KqJGU_e1KS9R93AjlGqnGsAi71xqyJjANNEnA_49Es1C4ldXjOnSaIbfBYFhnaiBP848H-IN9rf80Z49Rbt0rGrACfZECkkhfPGoXycypqjiCpl7GyEls0VCG1tqGBnB13G?key=tJ3Ij5l_U8pFZJhhCNTG8g)

### **API Key Details**

The API Key is always linked to **one vault depositor address** and can be used on both Testnet and Mainnet.

**Example:**

If you deposit 1 ETH into the mainnet vault at `0x32faBA244AB815A5cb3E09D55c941464DBe31496`

or another 1 ETH into the testnet vault at `0xbA72A10ce8496DC9C13b9eE8c35fcCD3809d3C81`

With the wallet address: `0x454cfaa623a629XXXXXXXXaeb85d54c42e91479d`

The API Key: `b854XXXX-XXXX-XXXX-XXXX-XXXXXXXXea10` will be linked to the funds of this wallet address in the vault.

{% hint style="success" %}
You can always withdraw your vault balance from your vault depositor address.
{% endhint %}


# Intent Based

The whole Zyfi API is a Solver in the Intent landscape.

The **Intent narrative in blockchain** refers to a user's specific goal that is submitted to a service and then executed by a 'solver,' which can be a person, an API, or another protocol to achieve the desired outcome.

At Zyfi, we've developed a complete Intent Solver, which consists of Zyfi's APIs associated with **Zyfi's paymaster contract**. This innovation addresses the user's intent to have gasless transactions sponsored by a third party, such as an NFT collection, a DApp, or a foundation.

## Intent Adjacent Function

Zyfi goes a step further by introducing a specific **Intent Adjacent function** to the API solver. Instead of requiring a DApp to pay gas fees for the end user, a third party like a brand, foundation, or NFT collection can sponsor the gas without needing direct API integration.

This parameter, called `CheckNFT`, is part of the API call of the [sponsored paymaster](/integration-guide/paymasters-integration/sponsored-paymaster). DApps that use associated NFT contract addresses can switch this parameter from **false to true** during the API call. This allows DApps to sponsor gas for **holders of any Zyfi NFT partner**, with the NFT collection consent.

## How to Use `checkNFT`

As a Dapp, you just need to switch the `checkNFT` parameter from `false` to `true` and ensure that the sponsoring NFT collection is registered beforehand with an associated Zyfi's Vault balance.

```typescript
const payload = {
   chainId: 324,
   feeTokenAddress: // Not needed if your sponsor 100% of the gas
   sponsorshipRatio: 100
   checkNFT: true, // All Zyfi's NFT partners vault could now sponsor gas for their holders on your Dapp
   replayLimit:
     from: "0x...",
     to: "0x...",
     data: "0x.."
   }
};
```

By simply activating this parameter, Zyfi enables gasless transactions for specific holders through a straightforward parameter switch.

<figure><img src="/files/qa5antxnWrJNnlJtpqJc" alt=""><figcaption><p>Zyfi's intent adjecent function</p></figcaption></figure>

When the `checkNFT` parameter is switched to `true`, all of Zyfi's NFT partner vaults could sponsor gas for their holders on your Dapp. This offers a flexible solution for Dapps to integrate; for third parties to sponsor, and an amazing solution for NFT holders who enjoy gas-free transactions.


# Paymaster Sybil Defense

In this section, we will explore how Zyfi is designed to prevent Sybil attacks and block malicious actors, and how integration partners can also protect themselves from Sybil attacks.

We all know what Sybil attacks are and they can be the worst event for an infrastructure project like Zyfi. It is always better to prevent a negative event than to react after it occurs. That's why this section exists: to prevent Sybil attacks and ensure that no one is affected.

### Signature Based paymaster

The most important concept to understand is our signature-based technology. When you integrate our [`erc20_sponsored_paymaster`](/integration-guide/paymasters-integration/sponsored-paymaster) or [`erc20_paymaster`](/integration-guide/paymasters-integration/erc20-paymaster) APIs, you're making a call from your front-end to the API, which constructs a transaction to be signed by the end users. This signature is validated by the paymaster contract, which means it is not possible to directly interact with Zyfi's paymaster contract unless it comes through Zyfi's API. Therefore, a malicious actor would need to go through our front-end or one of our partner's front-ends to execute any action.

#### **Extracted value**

A malicious actor's only option would be to consume all the sponsored transactions offered by a Dapp partner using the [`erc20_sponsored_paymaster`](/integration-guide/paymasters-integration/sponsored-paymaster). Unlike the [`erc20_paymaster`](/integration-guide/paymasters-integration/erc20-paymaster), which doesn't require an API key and has no financial value attached (no vault contract), the attacker would need to exploit the gas provided through the sponsored paymaster API. However, this would not lead to any profit for the attacker—only the depletion of gas that Dapps generously provide.

#### Prevention and Solutions

To ensure the Zyfi API is secure for its partners, we have considered various scenarios and developed specific configurations to mitigate them:

1. **Scenario 1: A malicious actor spamming the API with a single account to extract value.**&#x20;

   Zyfi has provided a way for Dapp partners to set a limit on free transactions per address. For example, Zyfi has implemented a restriction for NFT collections to provide 10 free transactions per holder with a limit per NFT. This prevents actors from spamming and consuming all the gas.<br>
2. **Scenario 2: A user creates multiple wallet addresses to consume gas across different addresses.** To combat this, Zyfi will introduce a global daily limit. For example, a Dapp can set a daily limit of $100, equivalent to around 1,000 free transactions. This way, only a portion of the vault can be consumed daily.

   Zyfi is working to monitor sudden rise in API calls and notify partners if strange activities detected.

### **How to Set Up These Prevention Measures?**

In the **first** scenario, Dapps can already limit the number of sponsored transactions per user or wallet address, which can be configured directly with the Zyfi team.

For the **second** scenario, development is still underway to enable Dapps to set a global daily limit to prevent this type of activity.

To keep things as straightforward as possible and provide a clear developer experience for our integration partners, all these settings will be configurable through the [dashboard for partners](https://www.zyfi.org/partners)

&#x20;


# Supported Tokens

In the next pages, you’ll find a list of all supported gas tokens across the ZK networks where Zyfi is integrated. Only mainnet networks are included.


# Supported Tokens on ZKsync

Normally, any traded ERC20 token on zkSync is natively supported. Please find below a non-exhaustive list of tokens that have been manually audited by zkSync.

If you need support on integrating a token or would like to discuss a sponsorship program, feel free to [contact us](https://t.me/Paul_Web3).\
\
Note: upgradable ERC-20s cannot be used as `feeToken`without being whitelisted from zkSync.&#x20;

| Token Name                   | Symbol    | Address                                      |
| ---------------------------- | --------- | -------------------------------------------- |
| Wrapped Bitcoin              | WBTC      | `0xbbeb516fb02a01611cbbe0453fe3c580d7281011` |
| Dai                          | DAI       | `0x4b9eb6c0b6ea15176bbf62841c6b2a8a398cb656` |
| WOO                          | WOO       | `0x9e22d758629761fc5708c171d06c2fabb60b5159` |
| Kyber Network Crystal        | KNC       | `0x6ee46cb7cd2f15ee1ec9534cf29a5b51c83283e6` |
| Maverick Protocol            | MAV       | `0x787c09494ec8bcb24dcaf8659e7d5d69979ee508` |
| Liquity USD                  | LUSD      | `0x503234f203fc7eb888eec8513210612a43cf6115` |
| Symbiosis                    | SIS       | `0xdd9f72afed3631a6c85b5369d84875e6c42f1827` |
| Holdstation                  | HOLD      | `0xed4040fd47629e7c8fbb7da76bb50b3e7695f0f2` |
| Wagmi                        | WAGMI     | `0x3613ad277df1d5935d41400a181aa9ec1dc2dc9e` |
| Fulcrom                      | FUL       | `0xe593853b4d603d5b8f21036bb4ad0d1880097a6e` |
| zkSwap Finance               | ZF        | `0x31c2c031fdc9d33e974f327ab0d9883eae06ca4a` |
| Mute                         | MUTE      | `0x0e97c7a0f8b2c9885c8ac9fc6136e829cbc21d42` |
| Domani Protocol              | DEXTF     | `0x9929bcac4417a21d7e6fc86f6dae1cc7f27a2e41` |
| Zorro                        | ZORRO     | `0x244c238325fc1bdf6eded726ee1b47d55895d944` |
| Grai                         | GRAI      | `0x5fc44e95eaa48f9eb84be17bd3ac66b6a82af709` |
| CVI                          | GOVI      | `0xd63ef5e9c628c8a0e8984cdfb7444aee44b09044` |
| Metavault Trade              | MVX       | `0xc8ac6191cdc9c7bf846ad6b52aaaa7a0757ee305` |
| Interport Token              | ITP       | `0xd03465338226ea0178337f4abb16fdd6df529f57` |
| zkSync id                    | ZKID      | `0x2141d7fe06a1d69c016fc638ba75b6ef92fa1435` |
| Wefi Finance                 | WEFI      | `0x81e7186947fb59aaaaeb476a47daac60680cbbaf` |
| Karat                        | KAT       | `0xcdb7d260c107499c80b4b748e8331c64595972a1` |
| Solarcoin                    | SLR       | `0xe027d939f7de6f521675907cf086f59e4d75b876` |
| Superlauncher                | LAUNCH    | `0xf6d9a093a1c69a152d87e269a7d909e9d76b1815` |
| zkApes Token                 | ZAT       | `0x47ef4a5641992a72cfd57b9406c9d9cefee8e0c4` |
| Idexo                        | IDO       | `0xdea6d5161978d36b5c0fa6a491faa754f4bc809c` |
| SpaceFi                      | SPACE     | `0x47260090ce5e83454d5f05a0abbb2c953835f777` |
| zkEra Finance                | ZKE       | `0x7b3e1236c39ddd2e61cf6da6ac6d11193238ccb0` |
| MacaronSwap                  | MCRN      | `0xafe4ca0bbe6215cbda12857e723134bc3809f766` |
| veSync                       | VS        | `0x5756a28e2aae01f600fc2c01358395f5c1f8ad3a` |
| TouchFan                     | TFT       | `0x14acccd04393f26ba155e5402aa6fddbb8e2254a` |
| Unlock Maverick              | UNKMAV    | `0x81fe5d73a48336129888d71bf164209cf646540f` |
| Whisper                      | WISP      | `0xc8ec5b0627c794de0e4ea5d97ad9a556b361d243` |
| Wrapped LIBERTAS OMNIBUS     | LIBERTAS  | `0xc6dac3a53d5d6de9d1d05aa6e28b8e9e41722601` |
| ZK inu                       | $ZKINU    | `0x45559297bdedf453e172833ac7086f7d03f6690b` |
| zkCULT                       | ZCULT     | `0x8aaaf6e6167825829ab29f260f246afe742fb243` |
| zkDoge                       | ZKDOGE    | `0xbfb4b5616044eded03e5b1ad75141f0d9cb1499b` |
| ZKGROK                       | ZKGROK    | `0x75c568a970e54a075b2a5475264cfcff672d2b89` |
| zkLaunchpad                  | ZKPAD     | `0x959ab3394246669914bddeaeb50f8ac85648615e` |
| zkLotto                      | ZKLOTTO   | `0x94466dcfe241db963af1bc9741a94daa87ab2169` |
| ZKPepe                       | ZKPEPE    | `0x90eea899185105d583d04b7bdbfb672fce902a53` |
| zkShib                       | ZKSHIB    | `0x5e38cb3e6c0faafaa5c32c482864fcef5a0660ad` |
| zkSwap                       | ZKSP      | `0x7ecf006f7c45149b457e9116392279cc8a630f14` |
| zkSync Bridged USDC (zkSync) | USDC      | `0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4` |
| Zynergy                      | ZYN       | `0x0231b3de40b6b3bdd28dcef037f1b7a3fcf5a95a` |
| Kannagi Finance              | KANA      | `0x26ac1d9945f65392b8e4e6b895969b5c01a7b414` |
| Bolt Token                   | $BOLT     | `0x61b41e0244133b9c9c47a57e51a5ef70be2c5dd4` |
| Bridged USDT                 | USDT      | `0x493257fd37edb34451f62edf8d2a0c418852ba4c` |
| Cheems Token                 | CHEEMS    | `0x08f328c72a9b420b7568415ed331a1c236e6f620` |
| Derp                         | DERP      | `0x0bf4cb727b3f8092534d793893b2cc3348963dbf` |
| Era Name Service             | ERA       | `0xecd9f240ed3895c77db676004328dd1d246f33c9` |
| eZKalibur                    | SWORD     | `0x240f765af2273b0cab6caff2880d6d8f8b285fa4` |
| Flashdash                    | FLASHDASH | `0x06662147240414cc0dc25e6414100750d346bc44` |
| GemSwap                      | ZGEM      | `0x2b64237277c605d07f17b96f9627712340c32981` |
| HeartX Utility Token         | HNX       | `0xc76997c863bac0f6e4b6d3c2404b06013a0b29e2` |
| Holdstation Utility GOLD     | UGOLD     | `0x10d967f46b06580c4a87b05c78f04e4df25c0db0` |
| Hush.cash                    | HUSH      | `0x6d27b6252b980ba4350a1e349a3b684237d5e986` |
| Impermax                     | IBEX      | `0xbe9f8c0d6f0fd7e46cdacca340747ea2f247991d` |
| iZUMi Finance                | IZI       | `0x16a9494e257703797d747540f01683952547ee5b` |
| TiUSD                        | TIUSD     | `0xc059767cb62f003e863f9e7bd1fc813beff9693c` |
| Long Mao                     | LMAO      | `0xb0c2bdc425fd01c33d8514f8be016070212bdc6a` |
| Omnisea                      | OSEA      | `0xd6c008fb375648972206518fb0b1a1b65f371d05` |
| Onchain Trade                | OT        | `0xd0ea21ba66b67be636de1ec4bd9696eb8c61e9aa` |
| ONEZ                         | ONEZ      | `0x90059c32eeeb1a2aa1351a58860d98855f3655ad` |
| Orbitpad                     | OPAD      | `0x3a4fea0cf14c18c21975ff08efe11c08cccefe10` |
| Pepera                       | PEPERA    | `0x60143f39b54a731ac790708c8719211878e638c3` |
| Pinnako                      | PIKO      | `0xf8c6da1bbdc31ea5f968ace76e931685ca7f9962` |
| Onsen Token                  | ON        | `0x286f34bf2384b38067709e2abb255aa16d79f0e5` |
| Snark Launch                 | $SNRK     | `0x533b5f887383196c6bc642f83338a69596465307` |
| Synapse Network              | ZKSNP     | `0x971b79ef5e76088af5e52c6d6aa3276c2190e45c` |
| Tarot                        | TAROT     | `0x7f2fd959013eec5144269ac6edd0015cb10968fc` |
| Tiny Era Shard               | TES       | `0xcab3f741fa54e79e34753b95717b23018332b8ac` |
| Wrapped Ether                | WETH      | `0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91` |
| Velocore                     | VC        | `0x85D84c774CF8e9fF85342684b0E795Df72A24908` |
| USD+                         | USD+      | `0x8E86e46278518EFc1C5CEd245cBA2C7e3ef11557` |
| Binance USD                  | BUSD      | `0x2039bb4116B4EFc145Ec4f0e2eA75012D6C0f181` |
| Matic Token                  | MATIC     | `0x28a487240e4D45CfF4A2980D334CC933B7483842` |
| Binance Coin                 | BNB       | `0x7400793aAd94C8CA801aa036357d10F5Fd0ce08f` |
| iZUMI Bond USD               | iUSD      | `0x1382628e018010035999A1FF330447a0751aa84f` |
| Rocket Pool ETH              | rETH      | `0x32Fd44bB869620C0EF993754c8a00Be67C464806` |
| Coinbase Wrapped Staked ETH  | cbETH     | `0x75Af292c1c9a37b3EA2E6041168B4E48875b9ED5` |
| ZeroLend USDC                | z0USDC    | `0x016341e6Da8da66b33Fd32189328c102f32Da7CC` |
| DeversiFi Token              | DVF       | `0xBbD1bA24d589C319C86519646817F2F153c9B716` |
| Wrapped Liquid Staked Ether  | wstETH    | `0x703b52F2b28fEbcB60E1372858AF5b18849FE867` |
| PancakeSwap Token            | CAKE      | `0x3A287a06c66f9E95a56327185cA2BDF5f031cEcD` |
| Curve USD Stablecoin         | crvUSD    | `0x43cD37CC4B9EC54833c8aC362Dd55E58bFd62b86` |
| Frax                         | Frax      | `0xb4C1544cb4163f4C2ECa1aE9Ce999F63892d912A` |
| Koi                          | Koi       | `0xa995ad25Ce5eB76972ab356168f5e1D9257E4d05` |
| USDC                         | USDC      | `0x1d17CBcF0D6D143135aE902365D2E5e2A16538D4` |
| zkSync                       | ZK        | `0x5A7d6b2F92C77FAD6CCaBd7EE0624E64907Eaf3E` |
| rsETHWrapper                 | wrsETH    | `0xd4169E045bcF9a86cC00101225d9ED61D2F51af2` |


# Supported Tokens on Abstract

Please find below a non-exhaustive list of gas tokens that are supported by Zyfi on Abstract.

If you need support on integrating a token or would like to discuss a sponsorship program, feel free to [contact us](https://t.me/Paul_Web3).

| Token Name    | Symbol | Address                                      |
| ------------- | ------ | -------------------------------------------- |
| Pudgy Penguin | PENGU  | `0x9eBe3A824Ca958e4b3Da772D2065518F009CBa62` |
| Bridged USDC  | USDC.e | `0x84A71ccD554Cc1b02749b35d22F684CC8ec987e1` |
| Wrapped ETH   | WETH   | `0x3439153EB7AF838Ad19d56E1571FBD09333C2809` |
| Tether        | USDT   | `0x0709F39376dEEe2A2dfC94A58EdEb2Eb9DF012bD` |


# Case Studies

Discover all of Zyfi's Case Studies

This will help you give you some ideas on how to implemet the Zyfi paymaster API into your DApp.

<figure><img src="/files/2owpoaJgNVa5rUYLOb6E" alt=""><figcaption></figcaption></figure>


# Case Study: SyncSwap

The integration of Zyfi plays a crucial role in enhancing SyncSwap users' experience by offering FREE swaps and LP activities on ZKsync.

<figure><img src="/files/azp2yH3RrwodG3gVL5fr" alt=""><figcaption></figcaption></figure>

SyncSwap is the biggest DEX on ZKsync in terms of TVL ($25M). They started their journey on this blockchain and provide different types of liquidity pools, including Classic Pools (x∗y=k), Stable Pools (x+y=k), and Concentrated Liquidity Pools.

## Gas Fees Management

High gas fees remain one of the main obstacles for blockchain users. While ZKsync is known for its lower transaction costs compared to Ethereum, active DeFi users still face fees that can quickly accumulate, especially for those who frequently transact or provide liquidity on decentralized protocols like SyncSwap.

## Implementation of Zyfi

To address these challenges, SyncSwap has integrated Zyfi, leveraging Paymasters and Intents on ZKsync Era to facilitate and optimize gas fee management. Through this collaboration, Zyfi introduced several key improvements for SyncSwap users:

* **Gas-free swaps**: SyncSwap users pay no fees when swapping.
* **Gas-free LP activities**: Whether providing liquidity to any type of pool or removing liquidity, users pay no fees for their on-chain activities on SyncSwap.

<figure><img src="/files/nLj9na1WROOfKePWUof2" alt=""><figcaption><p>Gas-free deposit in a ZK/ETH pool on SyncSwap</p></figcaption></figure>

Thanks to Zyfi's integration, SyncSwap has significantly enhanced the user experience. Users can now avoid the complexity of managing native network tokens for each transaction while enjoying gas-free transactions.&#x20;

Additionally, the gas fee sponsorship model has attracted new users to **SyncSwap**, encouraging them to try a system where transaction fees are sponsored, further boosting the platform's popularity on ZKsync Era.

## UX/UI Implementation

To summarize the points mentioned above, the UX/UI implementation followed a structured process:

1/  The **first** step was to determine which types of on-chain actions and UI improvements they wanted to display. In this case, they aimed to allow users to pay no gas fees on **swaps** and **LP activities**.

2/  The **second step** involved integrating the API into their front end, which took about **0.5 day**, while ensuring the correct on-chain actions were triggered to sponsor activities like swaps and LP depositing and withdrawing.

3/  The **final step** was to implement changes on the **UI** side. They decided to create a simple box on the swap page to inform users that the swap or LP activities are gas-free and sponsored by Zyfi. They also added a message: "This transaction is GAS-FREE, sponsored by Zyfi" in the success box. This took another 0.5 day of development time.

And that’s it! 🎉

<figure><img src="/files/D1eiXv8z48zlWgH87i2p" alt=""><figcaption><p>Gas-free swaps on SyncSwap thanks to Zyfi</p></figcaption></figure>

In total, SyncSwap needed **1 development** day to integrate the entire product into their front end, providing an exceptional on-chain experience for users.

## Results

In terms of results, SyncSwap attracted many users during the release of the Zyfi integration and has sponsored over 23,000 transactions as of October 1st, 2024, with an average of 500 sponsored transactions per day.

<figure><img src="/files/u8D2FIfXlw07b40qPlir" alt=""><figcaption><p>Daily sponsored transactions on ZKsync Era on SyncSwap using the Zyfi paymaster</p></figcaption></figure>

## Conclusion

The integration of Zyfi with SyncSwap represents not just a technological breakthrough but also a revolution in user experience within the DeFi space. By removing the constraints related to gas fees on swaps and LP activities, Zyfi has enabled **SyncSwap** to position itself as a leader on the ZKsync Era blockchain while providing users with a smoother, more affordable, and accessible experience.


# Case Study: Venus Protocol

The integration of Zyfi marks a milestone for Venus Protocol, eliminating gas fees and enabling seamless, cost-free lending and borrowing for users.

<figure><img src="/files/NV2yHdbknmnZiQeW7MSB" alt=""><figcaption></figcaption></figure>

**Venus** **Protocol** is the leading lending protocol by TVL on the ZKsync Era chain. Created in 2020, Venus is a money market that enables decentralized loans and credit systems across six different chains. In addition to allowing users to lend and borrow assets, Venus offers complementary services such as vaults for their governance token, XVS.

## The Burden of Gas Fees

A common **challenge** in the adoption of decentralized applications is gas fees, which can pose a barrier to smooth and accessible use. For Venus users, these gas fees add complexity not only in terms of costs but also in terms of user experience, potentially deterring newcomers and complicating interaction with the protocol.

## The Integration of Zyfi's Paymaster

Zyfi offers a paymaster service, allowing Venus to sponsor gas fees for all on-chain actions of its users. Through the ZKsync stack and native account abstraction, Zyfi simplifies the user experience by making all the following actions on Venus entirely gas-free:

* **Approval** — All approvals are gasless
* **Supply** — Lend in any pool for free
* **Withdraw** — Withdraw from pools anytime for free
* **Borrow** — Borrow from any pool for free
* **Repay** — Repay loans in any pool for free
* **XVS Vault** — Deposit/withdraw in the XVS Vault for free

<figure><img src="/files/TETbgcKZp8gqBfVHJ25C" alt=""><figcaption><p>Gas-free lending on Venus</p></figcaption></figure>

With Zyfi's paymaster, all on-chain actions on **Venus** through ZKsync are now gas-free, creating a seamless and optimized user experience. Users can approve transactions, lend assets, withdraw funds, borrow or repay loans, and interact with the XVS Vault without any gas fees.

From a user perspective, Zyfi completely eliminates the gas fee barrier, offering a simplified and seamless experience.

## UX/UI Implementation

Here’s how the UX/UI implementation process worked:

1. **Choose Sponsorship Type** — All on-chain actions are made free for users.
2. **API Integration** — Venus integrated Zyfi’s API into their front end in about one day, enabling gas-free actions like lending, borrowing, and XVS Vault activities.
3. **UI Adjustment** — A “FREE” box was added to the ZKsync network interface to notify users that all on-chain actions are gas-free.

And that’s it! 🎉

<figure><img src="/files/AXDmpxP9I5Olk6J8uwIt" alt=""><figcaption><p>Gas-free activities on Venus thanks to Zyfi</p></figcaption></figure>

In total, Venus needed only **1 development** day to integrate the entire product into their front end, providing an exceptional on-chain experience for users.

## Results

Since the Zyfi integration, Venus has attracted numerous users, sponsoring around 400 transactions per day as of October 30th, 2024, which is significant for a lending protocol.

<figure><img src="/files/ntgF4N8xyKzcFJKa16pv" alt=""><figcaption><p>Daily sponsored transactions on ZKsync Era on Venus using the Zyfi paymaster</p></figcaption></figure>

## Conclusion

The integration of Zyfi’s paymaster underscores the evolution of interfaces and user experience in on-chain applications. Thanks to this solution, Venus offers a frictionless experience, allowing users to focus entirely on using the protocol without concerns over transaction fees.


# Case Study: PancakeSwap

The integration of Zyfi with PancakeSwap simplifies users' experiences by offering seamless swaps on ZKsync and specific gasless events (e.g., airdrops).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcOzfvxb6O6xKwfzERcry1xt1mKqcJRpbyERPR7ZLGpjtblMbrsP5DGG1fzdO7X9m-HkxE9DjfERBRbKsv_Q1DtO5Ct6cZXLOy7X23HF51Wxm0pHDiaRzX5kzAsC6jTQUFA8Dx_huML4p8FPbHNEQmfH8oK?key=pwvnNMywISI2HmSAlydpyg" alt=""><figcaption></figcaption></figure>

PancakeSwap, one of the largest decentralized exchange (DEX) platforms, has always sought to improve user experience and push the boundaries of decentralized finance (DeFi). Since its launch on the [ZKsync Era blockchain in July 2023](https://blog.pancakeswap.finance/articles/pancake-swap-v3-on-zk-sync-era), PancakeSwap has capitalized on the benefits of Zero-Knowledge (ZK) technology, providing fast and low-cost trading on a Layer 2 infrastructure. However, despite these advantages, a key issue remains: **gas fees.**

## Complex Gas Management

In the DeFi ecosystem, users often have to pay gas fees in the network’s native tokens (like ETH on Ethereum), creating significant friction. This complicates wallet management and adds a constraint for users who must hold these specific tokens. Moreover, gas fees cannot be sponsored on all types of EVM accounts, whether Smart Wallet or EOA, which can disrupt the on-chain experience.

## Implementation of Zyfi, native Account Abstraction provider

To address these challenges, **PancakeSwap has integrated Zyfi**, an innovative gas abstraction provider leveraging native AA on ZKsync Era to facilitate and optimize gas fee management. Through this collaboration, Zyfi introduced several key improvements:

* **Paying gas fees with ERC-20 tokens:** PancakeSwap users can pay gas fees with over 10 ERC-20 tokens, enhancing flexibility and accessibility.
* **Gas fee sponsorship:** PancakeSwap decided to integrate the [sponsored paymaster](/integration-guide/paymasters-integration/sponsored-paymaster) to cover transaction fees for users, allowing gas-free swaps on their DEX up to a limit of $5,000, equating to nearly 150,000 free transactions. This enables users to conduct swaps without worrying about gas costs until the sponsorship cap is reached.
* **Gasless airdrop claiming:** During the Token Generation Event of ZKsync, PancakeSwap [offered](https://cointelegraph.com/news/pancakeswap-2-4m-zk-token-airdrop) its native allocation to users, and each token claim was fully gasless thanks to Zyfi's integration.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd5onyrz9GBU1GtB192tMhxckGIbwQPB7lIUUv_cJuJpj6kOuSiJwRYk9Xc8b9MQeU04_UOjAllWnw1q66OzVAqwJyxFRkblbbuz0WSuTzWmvf4I4zob4Eo0eFXjXxR_aELcheuwxbsTt4edhQy7CvBH3la?key=pwvnNMywISI2HmSAlydpyg" alt=""><figcaption></figcaption></figure>

Thanks to Zyfi's integration, PancakeSwap has significantly enhanced user experience. Users can now avoid the complexity of managing native network tokens for each transaction while enjoying gas-free transactions.&#x20;

Additionally, the gas fee sponsorship model has also **attracted new users to PancakeSwap**, encouraging them to try a system where transaction fees are sponsored, further boosting the platform's popularity on ZKsync Era.

## UX/UI Implementation

To summarize the points mentioned above, the UX/UI implementation followed a structured process.&#x20;

1/ The **first** step was for them to determine which types of on-chain actions and UI improvements they wanted to display. In this case, they aimed to allow users to pay gas fees with any token, offer sponsored transactions, and facilitate a gasless minting event.&#x20;

2/ The **second** step involved integrating the API into their front-end, which took **about 0.5 days**, while ensuring the correct on-chain actions were triggered to sponsor activities like swaps and claims, as well as displaying all the tokens available for gas payments.&#x20;

3/ The **final** step was to implement changes on the **UI side**. They decided to create a simple box that listed all ERC-20 tokens for gas payments, with a “Free” label next to each token indicating where the gas was sponsored. This took 0.5 days of development time. In their specific case, all tokens were eligible for free transactions.

And that’s it! 🎉

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfBoEHaqEzVmDQXkIgymjkQDAudc0M3AyiVzAjV-Q5JRLvM3RSHF5c2U9TX2sJsK9PBILPQF7Qcxle1c_vEE4jRvA-7otJmgD9z5ZzsUMe47dBS4xGh8T5p5AUdF49chE8Bjn2SHNsGPNprFwEpE-AckDuJ?key=pwvnNMywISI2HmSAlydpyg" alt=""><figcaption><p>UX/UI of PancakeSwap with Zyfi integration</p></figcaption></figure>

In total, PancakeSwap needed **1 development day** to integrate the entire product into their front-end, providing an exceptional on-chain experience for users on both mobile and desktop.&#x20;

## Results

In terms of results, PancakeSwap attracted many users during the release of the Zyfi integration and has sponsored over 140,000 transactions as of September 2024.&#x20;

In the screen below, you can see PancakeSwap transactions after the Zyfi integration [(11 June 2024)](https://cointelegraph.com/news/pancakeswap-gasless-transactions-zyfi-integration) and the gasless claiming transactions for their airdrop.

<figure><img src="/files/sdiLt9Sdq4j281mhtypB" alt=""><figcaption><p>Daily transaction on ZKsync Era on PancakeSwap before and after they started using the paymaster.</p></figcaption></figure>

## Conclusion

The integration of Zyfi with PancakeSwap represents not just a technological breakthrough but also a revolution in user experience within the DeFi space. By removing the constraints related to gas fees and offering innovative, transparent solutions, Zyfi has enabled PancakeSwap to position itself as a leader on the ZKsync Era blockchain while providing users with a **smoother, more affordable, and accessible experience.**<br>


# Case Study: Koi Finance

Koi finance integrate Zyfi's paymaster solution to offer the best on-chain user experiences.

<figure><img src="/files/J0lRhjPfptiZbtct3kGr" alt=""><figcaption></figcaption></figure>

Koi Finance is one of the biggest DeFi applications on ZKsync in terms of activity and TVL. They offer a comprehensive suite of solutions for liquidity providers, including **stable pools, concentrated liquidity pools, and staking farms** for LP tokens. As a DAO, Koi Finance is governed by veKOI, a vote-escrowed NFT that enables holders to actively participate in treasury management and protocol rewards.

## Gas Fees Management

However, despite its innovations, Koi Finance, like many decentralized protocols, faces a recurring challenge: gas fees. These often unpredictable fees can hinder user engagement and complicate the experience of using decentralized applications (DApps). Every on-chain action, such as token swaps or withdrawing liquidity rewards, incurs gas costs that can discourage users from interacting with the platform frequently.

## Implementation of Zyfi

To address these challenges, Koi Finance has integrated Zyfi, leveraging Paymasters and Intents on ZKsync Era to optimize gas fee management. Through this collaboration, Zyfi enables several key improvements for Koi Finance users:

* **Free LP activities**: Add/remove liquidity on their V3 and classic pools
* **Free Swaps**: Gas-free swaps on their swap page
* **Free Rewards Collection**: Collect rewards from their pool without gas fees
* **Free Locking/Unlocking**: Locking governance tokens from Koi to veKOI is free

<figure><img src="/files/bKeLde88J8h5LH0NUFNQ" alt=""><figcaption><p>Gas-free deposit in a USDC.e/ETH pool on Koi Finance</p></figcaption></figure>

Thanks to Zyfi's integration, Koi Finance offers the best on-chain user experience, where users no longer need to think about gas fees.&#x20;

Additionally, the gas fee sponsorship model has attracted new users to Koi Finance, encouraging them to try a system where transaction fees are sponsored, further boosting the platform's popularity on ZKsync Era.

## UX/UI Implementation

To summarize, the UX/UI implementation followed a structured process:

1. The **first** step was to determine which on-chain actions and UI improvements to display. They aimed to eliminate gas fees for all on-chain actions (transactions and approvals).
2. The **second** step involved integrating the API into their front end, which took about 1 day, ensuring the correct on-chain actions were triggered to sponsor activities like swaps, LP deposits, and reward collections.
3. The **final** step was implementing changes to the UI. They added a simple box with the label "Gas-less" for all available on-chain actions. This took an additional 0.5 days of development time.

And that’s it! 🎉

<figure><img src="/files/ImHU2rBvHcS34nKYrIRn" alt=""><figcaption><p>Gas-free swaps on Koi Finance thanks to Zyfi</p></figcaption></figure>

In total, Koi Finance needed **1.5 development** day to integrate the entire product into their front end, providing an exceptional on-chain experience for users.

## Results

Koi Finance attracted many users after the Zyfi integration, sponsoring over **52,000 transactions** as of October 10, 2024, with an average of 800 sponsored transactions per day.

<figure><img src="/files/6TxuBFN0kC95wWS1h032" alt=""><figcaption><p>Daily sponsored transactions on ZKsync Era on Koi Finance using the Zyfi paymaster</p></figcaption></figure>

## Conclusion

The integration of Zyfi with Koi Finance represents not just a technological breakthrough but also a revolution in user experience within the DeFi space. By removing the constraints related to gas fees on swaps and LP activities, Zyfi has enabled **Koi Finance** to position itself as a leader on the ZKsync Era blockchain while providing users with a smoother, more affordable, and accessible experience.


# Case Study: Nodle

Nodle has integrated Zyfi's paymaster solution into its app.

<figure><img src="/files/eUtnh0lhXaGMJXkGdQjQ" alt=""><figcaption></figcaption></figure>

Nodle is a decentralized physical infrastructure (DePIN) project, initially launched on the Polkadot blockchain, is now migrating to the Elastic Chain network of ZKsync. [These Elastic Chains](https://zksync.mirror.xyz/BqdsMuLluf6AlWBgWOKoa587eQcFZq20zTf7dYblxsU), a chain-of-chain concept recently launched by ZKsync, use the ZKstack and offer benefits like low-cost usage, ease of use, and mathematical security.

## Gas Fees Management

One of the main challenges for blockchain users is managing transaction fees, or “gas fees,” which can be both complex and costly. This is particularly true for users who operate across multiple wallets or networks and need to manage various native tokens to cover these fees. This complexity can limit adoption and ease of use of decentralized applications, creating obstacles for both users and developers.

## Implementation of Zyfi

To simplify gas fee management, Nodle integrated Zyfi's paymaster on ZKsync Era. This collaboration enables users to pay transaction fees directly in $NODL, eliminating the need to acquire additional tokens like ETH to cover gas costs.

Now, Nodle users on the ZKsync network can pay fees in $NODL. The app now offers an optimized on-chain experience where ETH is no longer required for gas fees.

<figure><img src="/files/bV8diJ5uo0IVzEBQxOHW" alt=""><figcaption><p>Pay your transaction with $NODL token as gas</p></figcaption></figure>

Additionally, the gas abstraction model has attracted new users to Nodle, encouraging them to try a system where transaction fees are paid in other token than ETH, further boosting the platform's popularity on ZKsync Era.

## UX/UI Implementation

To summarize, the UX/UI implementation followed a structured process:

1. The **first** step was to determine which on-chain actions and UI improvements to display. The team focused on allowing users to pay gas fees with $NODL.
2. The **second** step involved integrating the API into their front end, which took about 1 day, ensuring the correct on-chain actions were triggered.
3. The **final** step was implementing changes to the UI. A simple message was added to the transaction screen, displaying the gas fee in $NODL.

And that’s it! 🎉

In total, Nodle needed **1.5 development** day to integrate the entire product into their front end, providing an exceptional on-chain experience for users.

## Results

Nodle attracted many users after the Zyfi integration, sponsoring over **70,000 transactions** as of December 5, 2024, with an average of 800 sponsored transactions per day.

<figure><img src="/files/c41rdfcaMN6nghwx9mw5" alt=""><figcaption><p>Daily sponsored transactions on ZKsync Era on Nodle using the Zyfi paymaster</p></figcaption></figure>

## Conclusion

The integration of Zyfi with Nodle represents not just a technological breakthrough but also a revolution in user experience within the DeFi space.


# Case Study: Click

Click has integrated Zyfi's paymaster solution into their app, fully sponsoring all transactions.

<figure><img src="/files/JKPsZaZlL60eoimH9XwC" alt=""><figcaption></figcaption></figure>

[Click](https://clickapp.com/) is a revolutionary application in the digital media ecosystem, offering a "trust network" solution that enables creators and consumers to easily authenticate photo and video content. Using ZKsync blockchain technology, Click combats misinformation by providing a simple and intuitive platform to verify the authenticity of creations on-chain.&#x20;

To enhance the user experience, Click partnered with Zyfi to eliminate barriers related to gas fees.

## Gas Fees Management

Managing gas fees is a recurring challenge for blockchain-based applications, especially those aimed at the general public. These fees can create a significant barrier for users, making it harder to adopt and regularly use applications like Click, which seeks to democratize content authentication.&#x20;

Click's goal was to provide a seamless user experience where users could authenticate their content without worrying about transaction fees.

## Implementation of Zyfi

To address this, Click integrated Zyfi’s sponsored paymaster on ZKsync Era. This partnership allows users to authenticate their content without incurring any transaction fees.

With Zyfi’s solution:

* Users can register their creations without realizing they’re signing a blockchain transaction.
* Click eliminates technological barriers, delivering an accessible and smooth experience for all users.

<figure><img src="/files/cfyRubqrLB3z8nKtxIbJ" alt=""><figcaption><p><strong>Left screen:</strong> The photo is not yet authenticated on the blockchain.<br><strong>Right screen:</strong> The photo is signed on the blockchain with no fees paid.</p></figcaption></figure>

## UX/UI Implementation

The integration process followed a structured approach:

1. **Define On-Chain Actions and UI Improvements:**\
   The team focused on fully sponsoring transactions to offer the best user experience—no need to think about gas fees.
2. **API Integration:**\
   The API was integrated into the front end in just one day.
3. **Zero UI Adjustments:**\
   Since the transactions are gasless, no additional UI changes were required, as users are unaware they’re signing a blockchain transaction.

**Total time:** 1 development day. 🎉

## Results

Click attracted many users after the Zyfi integration, sponsoring over **53,000 transactions** as of December 11, 2024, with an average of 800 sponsored transactions per day.

<figure><img src="/files/96kcdp7xCPVMw7mv9qZ2" alt=""><figcaption><p>Daily sponsored transactions on ZKsync Era on Click using the Zyfi paymaster</p></figcaption></figure>

## Conclusion

The integration of Zyfi with Click represents not just a technological breakthrough but also a revolution in user experience within the on-chain authentification space.


# Case Study: Ebisu's Bay

Ebisu’s Bay has fully integrated Zyfi’s paymaster solution, sponsoring transactions for users.

<figure><img src="/files/OF4FvVDStedFvnfp9bdJ" alt=""><figcaption></figcaption></figure>

[Ebisu’s Bay](https://www.ebisusbay.com/) is an innovative platform merging NFT, DEX and token trading with immersive GameFi experiences. As the first NFT marketplace and DEX on [Cronos zkEVM](https://docs.cronos.org/cronos-zkevm/cronos-zkevm), it stands out with community governance and enriched features, enabling users to engage in battles and strategic gameplay while trading digital assets. However, as with many blockchain applications, gas fees can negatively impact the user experience.

## Gas Fees Management

Gas fees are a recurring challenge in the blockchain ecosystem, particularly for users unfamiliar with the system or those aiming to maximize their investments. These fees often act as a barrier to adoption and accessibility, limiting user engagement on platforms like Ebisu’s Bay.

A seamless solution was needed, especially in a gaming, NFT, and trading environment.

## Implementation of Zyfi

By leveraging the ZK Stack with native Account Abstraction, Ebisu’s Bay integrated Zyfi, enabling it to cover gas fees for users. Transactions are now conducted without direct fees, and users can even pay with a variety of tokens. This significantly improves the user experience by making transactions transparent and hassle-free.

**With Zyfi’s Solution:**

* Ebisu’s Bay users can swap using **5+ ERC-20 tokens as gas.**
* Transactions are free when users select **FRTN** (Ebisu’s Bay’s platform token) as the gas fee token.

<figure><img src="/files/OK0UErFqzMarJeQGqgGO" alt=""><figcaption><p>On the right: An example swap using <strong>FTRN</strong> as gas on Ebisu’s Bay swap card.</p></figcaption></figure>

## **UX/UI Implementation**

The integration process followed a structured approach:

1. **Defining On-Chain Actions and UI Improvements:**\
   The team focused on sponsoring transactions for token holders and allowing payments with 5+ tokens as gas.
2. **API Integration:**\
   The API was seamlessly integrated into the front end in just one day.
3. **UI Adjustments:**\
   A dropdown menu was added to the swap card to display available gas fee tokens.

**Total Time:** 1.5 development days 🎉

## Results

Ebisu's Bay attracted many users after the Zyfi integration, sponsoring over **5,430 transactions** as of December 20, 2024, with an average of 100 sponsored transactions per day.

## Conclusion

The integration of Zyfi with Ebisu's Bay represents not just a technological breakthrough but also a revolution in user experience within the on-chain authentification space.


# Case Study: Mithraeum

Zyfi's integration with the fully on-chain game Mithraeum marks a major breakthrough in blockchain gaming, enabling uninterrupted gameplay by eliminating gas fee payments.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXej29Ezkqc0_cpjXAKGjFF3UofCGFVEzlvxGeuZ9Jvz8Z4JklBlmev394YdOOHaV6WVueX7hUZU3zMkT3-sW295H4YNbtgBHhfbaj-6_sUk9uMR3vFpIKC2PmTKsAlUHHhCPVrzmT-PTnbqtm0scOFqyMLa?key=LfmIHxG_TrGqrDYMcbnfQA" alt=""><figcaption></figcaption></figure>

## What's Mithraeum?

[Mithraeum](https://mithraeum.io/) is a fully decentralized, real-time strategy game recently launched on ZKsync, incorporating core blockchain principles like decentralization. In Mithraeum, players are immersed in historical periods, participating in large battles, sieges, and alliances on a unique world map.&#x20;

The game is supported by prominent blockchain partners, including **Gnosis Chain**, **Arbitrum,** **ZKsync**, and is dedicated to maintaining decentralization while allowing community contributions to its development.

Despite its decentralization, Mithraeum faces a significant challenge: **gas fees**. Every action performed on-chain requires a transaction, leading to frequent gas fee payments that can disrupt gameplay and diminish the user experience. Users often encounter numerous MetaMask pop-ups to approve transactions and pay gas fees, which **detracts from the game's immersion** and appeal.

## Zyfi: Paymaster on ZKsync

Zyfi offers a solution to these issues on ZKsync. By leveraging ZKsync’s native Account Abstraction (AA) and [Zyfi's sponsored paymaster](/integration-guide/paymasters-integration/sponsored-paymaster), Mithraeum users can avoid gas fees entirely, providing a smooth, uninterrupted experience. Zyfi's paymaster smart contracts cover the gas costs for users' transactions, allowing Mithraeum to deliver a seamless gaming experience without frequent interruptions for gas payments.

As part of the launch initiative, Zyfi has sponsored **20,000 gas-free transactions**, equivalent to **$2,000 worth of gas**. This initial funding ensures that early Mithraeum users can enjoy the game without worrying about transaction costs, thereby boosting adoption and engagement within the Mithraeum ecosystem.

<figure><img src="/files/rkyJbB1eb8p2K0MzSnLD" alt=""><figcaption><p>Overview of the Mithraeum on-chain game.</p></figcaption></figure>

## UX/UI Implementation and Sybil Prevention

The UX/UI implementation time depends on the design choices. As a gaming platform, Mithraeum decided to use the [sponsored paymaster:](/integration-guide/paymasters-integration/sponsored-paymaster)

* **Full Sponsorship:** They chose to cover 100% of gas fees for users to ensure a seamless experience.
* **Sybil Prevention:** To prevent Sybil attacks, they implemented a credit system per address, allowing each user to enjoy a certain number of free transactions.
* **UI Update:** A simple checker (see image below) at the beginning of the game was added to let users choose if they want to enjoy free transactions or not.

The UX/UI implementation for Mithraeum took around 1 development day to complete, with sybil prevention being one of their biggest concerns. The credit system for each address was an effective method to offer the best on-chain gaming experience while preventing Sybil attacks.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeuqyeK9erh1lhnOgx35JA2PihV29TYGE9PsKebGo3yV2t89FveV9AxmgIRxVXSlDAwXHicmomE-cmN58A9hrbbcp3iYejEHFv84ztP0SLfmd0knKwMpRDsmv_QDsdVK_njljx1blofh0q-JlnuCo-eL7sY?key=LfmIHxG_TrGqrDYMcbnfQA" alt=""><figcaption><p>Onboard Step into the Mithraeum game where users can decide to activate gas-free fees.</p></figcaption></figure>

### Conclusion

The integration of Zyfi's paymaster solution into Mithraeum significantly enhances the user experience by eliminating gas fee interruptions, addressing one of the major barriers to on-chain gaming. This approach also allows Mithraeum to remain committed to its decentralized principles while offering a **smooth and engaging experience.**&#x20;


# Case Study: Gravita

The initial integrations of Zyfi have demonstrated that a paymaster-as-a-service solution can significantly boost daily active users, as well as the volume and frequency of transactions.

Drawing on the successful integration by Gravita Protocol, one of Zyfi's early adopters, we've distilled valuable insights into effective UI practices. User demand for Paymaster is [constantly increasing as it can be seen from this Dune Dashboard.](https://dune.com/zyfi/zyfi-usage-overview)

<figure><img src="/files/FU1xx9GF5cAWKJxUIt2g" alt=""><figcaption></figcaption></figure>

## **Advantages**

* **Wide Token Acceptance**: Supports more than 80 ERC-20 tokens.
* **Transparent Fees**: Users see and approve only the exact amount needed, which is available upfront, optimizing costs and security.
* **Gas Refunds**: Unspent gas is refunded in the fee token it was paid in.
* **Instant Quotes**: The API delivers real-time fee quotes and discounts, improving user experience.

## **UI and UX implementation - Overview of Best Practices**

Unlock the full potential of your platform with simply crafted UI enhancements and additions:

1. **Add a tooltip with a Gas Icon and Display the Wallet Balance of the user**:
   * Ensure the user's wallet and token balances are easily visible near this icon.
2. **Spotlight on Paymaster Service - Clear Indicators for Paymaster Availability**:
   * Utilize eye-catching elements like colour contrasts or animations shining a spotlight on the revolutionary and cutting-edge paymaster service availability.
3. **Highlighting Savings: Unveil Discounts with Clarity**

   * Clearly display any discounts on gas fees available through the paymaster service.
   * Use visual cues like percentage-off tags or highlighted text to indicate savings.

   This approach not only highlights a key advantage your protocol offers compared to competitors, but also gives users a solid reason to return and transact more, driving even more engagement with your protocol.

<div align="center" data-full-width="false"><figure><img src="/files/nWoVkRmpe6vAEk0AAMnh" alt=""><figcaption><p>Zyfi and it's partners are happy to sponsor a discount on transaction fees for the first users</p></figcaption></figure></div>

## **Additional Considerations - Optional**

* **Zyfi Airdrop Participation:** users executing transactions through Zyfi will receive an airdrop from the protocol. A dashboard will soon be available with more information about this program.&#x20;
* **Remember User Preferences with Cookies**: Utilize cookies to save user preferences for future visits - consider not displaying the "Attention-Getter" or popup again or for a certain amount of time if the user closed it previously. When a user selects a token for gas payment, store this choice so that it's pre-selected upon their return, streamlining their experience.
* **Feedback Mechanisms**: Implement real-time feedback on gas fee calculations, discount and sponsoring as users select different tokens, or after they complete a transaction.
* **Documentation:**  you can also write your own documentation, [feel free to get inspired by Gravita's one linked here.](https://docs.gravitaprotocol.com/gravita-docs/how-does-gravita-work/paymaster-on-zksync)
* **Mobile**: Ensure that all elements are accessible and usable, without forgetting mobile users.

<figure><img src="/files/DfoWVNVUb2f20lm6XJa2" alt=""><figcaption><p>Do not forget mobile users!</p></figcaption></figure>

## **Conclusion**

In conclusion, embracing these best practices guarantees a seamless and efficient experience for users paying gas on your protocol with any ERC-20 token, including your token!&#x20;

[Check out our Dune Dashboard](https://dune.com/zyfi/zyfi-usage-overview) to see how much utilisation of Paymaster Services has increased over time.\
\
Consider extending the use of your token as a gas payment option to your partners and across zkSync: ZyFi works with DEXes, lending platforms, NFT marketplaces, gaming ecosystems and more.&#x20;


# Case Study: Router Nitro

Zyfi’s integration with Router Nitro marks a significant development in the DeFi space, enabling cross-chain swaps from ZKsync without the need for ETH to pay gas fees.

Router Nitro, developed by [Router Protocol](https://www.routerprotocol.com/), is an ultra-efficient cross-chain bridge designed for high performance and low costs, supporting transactions across both EVM and non-EVM blockchains. This integration reflects a growing need for smoother, more accessible cross-chain swaps while minimizing the overhead of multiple assets for transaction fees.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf6nAPyNeCHdN3mv1W8HGn7KoS7baKN0lE4HBf8oPGQ2QKgvxiHs1tEu_X3XVmAVIRZqw9Z7zJ35m2DUJ4ZkkHclgGnqOtWwRjj5N2uPAnlSK-1HLQyJT7UHhNHR0i5QcCdjLcOApVsApqPMBEWCx1Ehgj6?key=6uohF2dCtOxMkmYtoaPxiw" alt=""><figcaption></figcaption></figure>

## Gas management issue

One of the biggest challenges in the **DeFi ecosystem** is the need to hold ETH in order to pay gas fees, even when conducting transactions using other tokens. This creates friction for users who might not have ETH in their wallet, especially when engaging in cross-chain swaps. Users often face delays or added complexity, needing to first acquire ETH before completing their desired transaction. This issue significantly affects **user experience** and the overall efficiency of DeFi transactions.

## Paymasters for EOA on ZKsync

Zyfi solves this long-standing issue on ZKsync by leveraging native AA and the Zyfi’s [ERC-20 paymaster](/integration-guide/paymasters-integration/erc20-paymaster) to allow the use of source tokens for gas fees. On ZKsync and ZK Stack chains, all wallets are treated as smart wallets by default, using the [same mempool and transaction flow](https://docs.zksync.io/build/developer-reference/ethereum-differences/native-vs-eip4337), enabling EOAs to enjoy Smart Wallet features like paymaster. By integrating Zyfi’s solution with a simple API call, Zyfi allows Router Nitro users to perform swaps without worrying about gas-fees. Now, when initiating a cross-chain swap from ZKsync, users can simply check “Pay Gas Using Source Asset” to use Zyfi’s paymaster, eliminating the need for ETH. This seamless gas abstraction experience [supports all ERC-20 tokens](https://docs.zyfi.org/integration-guide/supported-tokens) as payment for gas fees, greatly simplifying the transaction process and improving accessibility.

<figure><img src="/files/ISjOlJh9ezR31bI7frQe" alt=""><figcaption><p>Pay gas using source asset</p></figcaption></figure>

## UX/UI Implementation

The UX/UI implementation time depends on your design choice. As a cross-chain bridge, Router Nitro opted for:

* Simplicity: A simple checkbox that doesn't impact the ease of performing a swap.
* Design: An implementation that seamlessly fits with Router Nitro’s website.

With an integration like Zyfi that simplifies the user experience, you encourage users to return frequently to your protocol. A simple checkbox, and your users no longer need to hold ETH in their wallet to complete the swaps they want.

In terms of development time, expect about **0.5 day** for the API call and **0.5 day** for the UI implementation (depending on your sponsorship or integration model). For example, if you want to let users choose their gas fee token, it will take a bit more time, as seen with [PancakeSwap](https://x.com/Zyfi_org/status/1800498640827687252).&#x20;

## Zyfi integration, enhance the developer experience

Zyfi’s biggest advantage is its straightforward integration process, enabling developers to deliver a seamless gasless experience in under a day. Router Nitro, for example, followed just two simple steps to allow their users to enjoy the power of paymaster on both Smart Wallets and EOAs:

1. Select the Paymaster they want to use—[ERC20](/integration-guide/paymasters-integration/erc20-paymaster) or [Sponsored](/integration-guide/paymasters-integration/sponsored-paymaster).
2. Integrate the Paymaster into their front-end.

And that’s it! 🎉

Additionally, by providing 1 or 2 wallet addresses to the Zyfi team, they can track all ERC20 paymaster transactions enabled for their users through a clear [Partner dashboard](https://www.zyfi.org/partners).

## Conclusion

As a result, Router Nitro users can now benefit from hassle-free, low-cost cross-chain swaps. This solution not only improves the user experience by removing the ETH dependency but also furthers Zyfi’s mission to offer a gasless experience across the entire ZKsync ecosystem. This collaboration positions Router Nitro as a key player in gas abstraction, making DeFi transactions more fluid and efficient while reducing costs for users.


# UI Ideas

In this section, we will present different UI ideas we've already explored with our integration partners.

## Flow 1: User pays with an ERC20

Having an user pay with an ERC20 token instead of ETH requires implementing an additional dropdown to select which token the user wants to use

### Selection next to the wallet connection

The user  selects globally the token he desires to use for his transactions.

On clicking, a selection of tokens is presented, which the Dapp can expand overtime.

&#x20;It's also possible to propose different discounts for specific tokens (e.g. below  the protocol's token has a higher discount)

See below the examples from [Koi Finance](https://dapp.koi.finance/swap), [PancakeSwap](https://pancakeswap.finance/swap?chain=zkSync\&inputCurrency=0x3355df6D4c9C3035724Fd0e3914dE96A5a83aaf4\&outputCurrency=ETH) and [Gravita](https://www.gravitaprotocol.com/).&#x20;

<figure><img src="/files/gCWN64m3ttZs3lxKKYJm" alt=""><figcaption><p>Example from KOI. The user selects the desired feeToken he desires to use for all his transactions.</p></figcaption></figure>

<figure><img src="/files/2pLqSlgVrFKXsxokgqD7" alt=""><figcaption><p>Example with PancakeSwap. The user select the desired feeToken he want to pay the gas with.</p></figcaption></figure>

<figure><img src="/files/ku7jwGukOs2tGb0cJGhh" alt=""><figcaption><p>Example from Gravita Protocol</p></figcaption></figure>

### Selection from the widget

At [Zyfi](/),  we propose the feeToken selection directly into the widget.

The input token of the swap is automatically pre-selected, but the user can choose another one if so desired.

<figure><img src="/files/0AGxPVUEoYsXu2Du1Azo" alt=""><figcaption><p>Example from Zyfi: the user can select a different feeToken on each swap</p></figcaption></figure>

## Flow 2: The transaction is sponsored

Our [sponsored paymaster](/integration-guide/paymasters-integration/sponsored-paymaster) allows you to provide free or discounted transactions to your users.

By setting the `sponsorshipRatio` parameter when calling our API on each transaction, any off-chain business logic is possible. You can offer free transactions to users based on their NFT holdings, the amount of tokens they want to swap, or even a specific pool you want to incentivize with no fees for providing liquidity.

Below are examples with [Koi Finance](https://dapp.koi.finance/), [PancakeSwap](https://pancakeswap.finance/swap?chain=zkSync\&inputCurrency=0x3355df6D4c9C3035724Fd0e3914dE96A5a83aaf4\&outputCurrency=ETH), [Zyfi front-end](https://www.zyfi.org/swap) and [zkMarket](https://www.zkmarkets.com/zksync-era).

**Koi Finance:** During a special event, Koi Finance decided to offer free transactions on all actions, including:

* Swap
* Add/remove LP
* Collect LP rewards
* Add/remove LP v3
* Collect LP V3 rewards
* Add/remove farm
* Collect farm rewards
* Lock/unlock Koi
* Collect locked Koi rewards

<figure><img src="/files/qL1IcNXFcMdGIuJwspgM" alt=""><figcaption><p>A user pays no gas fee to enter and deposit liquidity in their pool</p></figcaption></figure>

**PancakeSwap:** As one of the eligible native projects on ZKsync Era, PancakeSwap decided to distribute all its allocations to ZKsync users. They opted to airdrop users and sponsor the claiming process, so users didn’t pay any fees for claiming.

<figure><img src="/files/IOhiqDuDa4akhBvg8pwb" alt=""><figcaption><p>Free Airdrop claiming</p></figcaption></figure>

**Zyfi Front-End:** In this example, the swap is fully sponsored if the user is purchasing over $100 of a token.

<figure><img src="/files/GVK3OrsfBK2DyOLi2yRk" alt=""><figcaption><p>Gas is covered if the user purchases over $100</p></figcaption></figure>

We can also allow other parties to sponsor transactions through our API. For instance, an NFT project can sponsor transactions for their holders.

<figure><img src="/files/GoAT4hxXFIAjTmfltElp" alt=""><figcaption><p>Free gas for zkSloth NFT holders</p></figcaption></figure>

**zkMarket**: There is a `CheckNFT:True` function in the API call, allowing you, as a Dapp, to offer free transactions to NFT partners' holders, sponsored by their vault contract (assuming they agree to sponsor the fees). An example is the zkMarket NFT marketplace, which enables free transactions for Frenzy Frog NFT holders.

<figure><img src="/files/pADGRXg6icd1pzdG69kM" alt=""><figcaption><p>A Frenzy Frog holder accesses the zkMarket front-end</p></figcaption></figure>


# Audits

#### Smart Contract Audits <a href="#smart-contract-auditors" id="smart-contract-auditors"></a>

At Zyfi, ensuring as much security as possible for our users stands at the core of our mission. \
\
Highlighting our dedication to security, Zyfi's smart contracts are designed to be immutable, significantly enhancing their appeal for several critical reasons:

* Audits conducted on these smart contracts remain perpetually valid, as the contracts are unchangeable and cannot be upgraded
* Users are relieved from the need to monitor for contract alterations that could potentially lead to fund losses or other nefarious consequences
* Such design choice eliminates any possibility for malicious actors to alter the code, or for external pressures (or attacks) to compel a developer to implement unfavourable updates, safeguarding against both cyber and physical threats

The integrity of our smart contracts has been rigorously tested both internally and through audits. Please find here a list of the audits that we performed on Zyfi's smart contracts:

* Cantina erc\_20 paymaster and erc20\_sponsored\_paymaster [report](https://www.zyfi.org/report-review-zyfi.pdf).


# About

The [<mark style="color:blue;">permissionless multi-signer paymaster</mark>](https://github.com/ondefy/permissionless-multisigner-paymaster/) enable ZKsync Dapps to seamlessly sponsor gas for their users through signature verification. Dapps can begin utilizing this paymaster by simply depositing funds and adding a signer address.

There are 2 primary actors involved:

* **Manager**: Fully managed by the dApp, responsible for depositing/withdrawing gas funds, and adding or removing signer addresses.&#x20;
* **Signers**: Managed by the dApp or a trusted third party like Zyfi’s API. A signer’s signature is required to access gas funds by the dApp’s user.


# How to set up?

Less than 1 minute is all it takes to set up your paymaster.

**There's just 1 simple step for activation**: DApps deposit gas funds and add a signer address in this paymaster through Zyfi's built front-end, completing it all in a single transaction.&#x20;

(Video)

You can also activate directly using ZKsync explorer by calling `depositAndAddSigner()` in the contract.

* ZKsync Mainnet : <https://explorer.zksync.io/address/0x68b4F1146a863d0E7cF1e134857411C8a941C86d#contract>
* Sepolia Testnet : \
  <https://sepolia.explorer.zksync.io/address/0xc1B0E2edC4cCaB51A764D7Dd8121CBf58C4D9E40#contract>

<figure><img src="/files/yLFvPWN9YKt44Uc8qXOO" alt="" width="375"><figcaption><p>ZKsync explorer</p></figcaption></figure>

[Done. Ready. All Set. Completed. Voilà. Paymaster activated ✅ 🫡](#user-content-fn-1)[^1]

The depositor address of the Dapp is the 'Manager' and the added signer address is the trusted 'Signer' whose signature will be verified for sponsorship in the paymaster to use the manager’s gas funds for the user.

> The Dapp’s **Manager** can add or remove multiple '**Signers'** as per requirement.

Below diagram explains how the permissionless paymaster works with your DApp:

<figure><img src="/files/FodEbz3TIRyNK8OAWRqz" alt=""><figcaption><p>Dapp integration flow with permissionless paymaster</p></figcaption></figure>

As a Dapp, you should have your own signer or delegate the signing part to Zyfi's API. You can easily integration Zyfi's API [here](/integration-guide/paymasters-integration).

> * A manager can have multiple signers.
> * All added signers will have access to the gas funds deposited by the manager.
> * In fact, a manager can be a signer address as well.

<figure><img src="/files/lZSwFmsUgvZ2Xzd0eM0g" alt=""><figcaption><p>Possible relations between signers and manager</p></figcaption></figure>

As a Dapp, you have nothing to handle except for funds added to the paymaster contract and any custom logic you want to apply.

### Zyfi At The Rescue

This paymaster can be integrated with Zyfi API as well. There are many Dapps who do not need a backend server just for paymaster. In that scenario, a Dapp can always delegate the "signer" to the Zyfi API and make [Zyfi API](/integration-guide/paymasters-integration) call based on the business requirement.&#x20;

<figure><img src="/files/wzFLmOTWoEIRZlNyv5yW" alt=""><figcaption><p>Dapps can choose to manage signer or delegate to Zyfi API</p></figcaption></figure>

[^1]:


# Technical Details

DApps can integrate this paymaster within 35 lines of code. This only concerns for Dapps who want to manage signer themselves.

### 1. What paymaster data would the signer key sign on?

* Paymaster validates upon EIP-712 type signatures.&#x20;

```
(_domainSeparator +
hash(
    SIGNATURE_TYPEHASH,
    _from,
    _to,
    _expirationTime,
    _maxNonce,
    _maxFeePerGas,
    _gasLimit
))
```

**\_from :** The user address the signer wants to sponsor.

**\_to:** The target contract user address is interacting i.e. Dapp's contract.

**\_expirationTime :** Timestamp post which the signature expires.

**\_maxNonce :** Nonce of the **user(\_from)** post which signature cannot be replayed.

**\_maxFeePerGas :** Current gas price returned by the provider.

**\_gasLimit :** Gas limit required by the transaction.\
Paymaster cost **60K** gas overhead. Hence, should be added while setting close gasLimit.&#x20;

* Following code represents what the exact values the are required to be signed by the signer(point 3 & 4 as per previous integration flow diagram):

```javascript
// Example code
// ethers v5
import {BigNumber, Contract, Wallet} from "zksync-ethers";
export async function getSignature(
  from: string, to: string, expirationTime: BigNumber, maxNonce: BigNumber, maxFeePerGas: BigNumber, gasLimit: BigNumber, paymaster: Contract
){
  const signer = new Wallet(process.env.SIGNER_PRIVATE_KEY, provider);
// EIP-712 domain from the paymaster
  const eip712Domain = await paymaster.eip712Domain();
  const domain = {
    name: eip712Domain[1],
    version: eip712Domain[2],
    chainId: eip712Domain[3],
    verifyingContract: eip712Domain[4],
  }
  const types = {
    PermissionLessPaymaster: [
      { name: "from", type: "address"},
      { name: "to", type: "address"},
      { name: "expirationTime", type: "uint256"},
      { name: "maxNonce", type: "uint256"},
      { name: "maxFeePerGas", type: "uint256"},
      { name: "gasLimit", type: "uint256"}
    ]
  };
// -------------------- IMPORTANT --------------------
  const values = {
    from,  // User address
    to, // Your dapp contract address which the user will interact
    expirationTime, // Expiration time post which the signature expires
    maxNonce, // Max nonce of user after which signature becomes invalid
    maxFeePerGas, // Current max gas price
    gasLimit // Max gas limit you want to allow to your user. Ensure to add 60K gas for paymaster overhead.
  }
// Note: MaxNonce allows the signature to be replayed.
// For eg: If currentNonce of user is 5, maxNonce is set to 10. Signature will allowed to replayed for nonce 6,7,8,9,10 on the same `to` address by the same user.
// This is to provide flexibility to Dapps to ensure signature works if users have multiple transactions running. 
// Important: Signers are recommended to set maxNonce as current nonce of the user or as close as possible to ensure safety of gas funds.
// Important : Signers should set expirationTime is close enough to ensure safety of funds.

// Signer wallet will already defined in the code
  return [(await signer._signTypedData(domain, types, values)), signer.address];
}
```

### 2. What extra data will be send with transaction for paymaster data?

* Once you get the signature, you simply need to add custom data to the user transaction as below(point 5 as per previous integration diagram) :

```javascript
// This is example code. Direct copy/paste won't work
import {utils, provider, Contract, BigNumber} from "zksync-ethers";

const paymasterAddress = "0x1fc6AAd6FFc4b26229a29432FbC4b65d5A5e462b";
const paymasterAbi = ["function eip712Domain() external view returns (bytes1 fields,string memory name,string memory version,uint256 chainId,address verifyingContract,bytes32 salt,uint256[] memory extensions);"];
const paymasterContract = new Contract(paymasterAddress, paymasterAbi, provider);
// Below part can be managed in getSignature() as well.
// ------------------------------------------------------------------------------------
// Note: Do not set maxNonce too high than current to avoid unwanted signature replay.
// Consider maxNonce is as replayLimit. And setting maxNonce to currentNonce means 0 replay.
// Get the maxNonce allowed to user. Here we ensure it's currentNonce.
const maxNonce = await provider.getNonce(userAddress);
// You can also check for min Nonce from the NonceHolder System contract to fully ensure as ZKsync support arbitrary nonce.
// -----------------
// const nonceHolderAddress = "0x0000000000000000000000000000000000008003";
// const nonceHolderAbi = ["function getMinNonce(address _address) external view returns (uint256)"];
// const nonceHolderContract = new Contract(nonceHolderAddress, nonceHolderAbi, provider);
// const maxNonce = await nonceHolderContract.callStatic.getMinNonce(userAddress);
// -----------------
// Get the expiration time. Here signature will be valid upto 60 sec. 
const expirationTime = BigNumber.from((await provider.getBlock).timestamp + 60);
// Get the current gas price.
const maxFeePerGas = await provider.getGasPrice();
// Set the gasLimit. Here, Dapp would know range of gas a function could cost and add 60K top up for paymaster overhead.. 
// Setting 215K (For eg: 150K function gas cost + 65K paymaster overhead)
// It will refunded anyways, so not an issue if Dapps set more.
const gasLimit = 215_000;
// ------------------------------------------------------------------------------------

const [signature, signerAddress] = await getSignature(userAddress,DappContract.address,expirationTime, maxNonce, maxFeePerGas, gasLimit, paymasterContract);
// We encode the extra data to be sent to paymaster
// Notice how it's not required to provide from, to, maxFeePerGas and gasLimit as per signature above. 
// That's because paymaster will get it from the transaction struct directly to ensure it's the correct user.
const innerInput = ethers.utils.arrayify(
      abiCoder.encode(
["uint256","uint256","address","bytes"], 
[expirationTime, // As used in above signature 
 maxNonce, // As used in above signature
 signerAddress, // The signer address
 signature]), // Signature created in the above snippet. get from API server
    );
   // getPaymasterParams function is available in zksync-ethers
const paymasterParams = utils.getPaymasterParams(
            paymasterAddress, // Paymaster address
            {
                type: "General",
                innerInput: innerInputs
            });
// Send the transaction with paymaster data. 
// Users will get transaction signature pop-up
const tx = await DappContract.<function>([args..],{
    maxFeePerGas, // Ensure it's same as used for signature
    gasLimit, // Ensure it's same as used for signature
    customData:{
       paymasterParams, // Paymaster address + paymaster data with signature.
       gasPerPubdata: utils.DEFAULT_GAS_PER_PUBDATA_LIMIT,
    },
  });

```

> Further documentation on this paymaster will be available soon [here](https://docs.zyfi.org/) & on [https://code.zksync.io](https://code.zksync.io/) .\
> Zyfi is also working on an SDK to reduces the above code into 5 lines of code.

### Miscellaneous

1. `_maxNonce` allows flexibility to Dapps by allowing signature replay in a secure constrained way. Signer should ensure maxNonce is not too big from the *current nonce* of the user and `_expirationTime` is not too far from the *current timestamp*. If `_maxNonce` is set to *current nonce of the user,* then signature cannot be replayed at all.<br>

   Check [here](https://github.com/ondefy/permissionless-multisigner-paymaster/blob/875a28b75f7f0c888b7b1ab61116cca0f49f0e46/contracts/paymasters/PermissionlessPaymaster.sol#L199-L203):

   <pre data-title="PermissionlessPaymaster.sol"><code>        // Validate that the transaction generated by the API is not expired
           if (block.timestamp > expirationTime)
               revert Errors.PM_SignatureExpired();
           // Validate that the nonce is not higher than the maximum allowed
           if (_transaction.nonce > maxNonce) revert Errors.PM_InvalidNonce();
   </code></pre>

   &#x20;
2. ZKsync might allow [arbitary nonce ordering ](https://docs.zksync.io/zk-stack/components/zksync-evm/bootloader#nonce-ordering)in future. To ensure surety over nonce of a user, you can add one more check by calling `getMinNonce` on the [NonceHolder system contract of ZKsync](https://github.com/matter-labs/era-contracts/blob/f4ae6a1b90e2c269542848ada44de669a5009290/system-contracts/contracts/interfaces/INonceHolder.sol#L17). For more details, check docs [here](https://docs.zksync.io/build/developer-reference/era-contracts/system-contracts#nonceholder) & [here](https://docs.zksync.io/sdk/js/ethers/api/v5/types#accountnonceordering).
3. This [paymaster has gas overhead of **51K-60K** gas](https://github.com/ondefy/permissionless-multisigner-paymaster/blob/main/technical_specs.md#gas), which is quite nominal compare to other paymaster gas overhead. Signer should ensure to add this overhead i.e. **60K** in the `_gasLimit`, if there are setting it close to the actual required gas.
4. Do not worry to set the `_gasLimit` high. All extra ETH spent from the manager's gas funds are refunded back to the manager.

### Markup charge

Zyfi Dao will have the ability to set the markup fee percent similar to Uniswap fee switch. Currently, markup is set to 0 percent.

Once activated, a markup percent will be charged on each transaction on the required ETH *(gasPrice\*gasLimit)* of the transaction and will be deducted from the respective manager's balance.

This markup will incentivise the DAO to promote paymaster evolution.

### FAQs

**1. Are there any fees for interacting with this paymaster other than potential markup fee set by the DAO?**\
**—** No, this paymaster is meant for common good. No fees on deposit, withdrawal, adding signers.

**2. What if the private key of our signer gets leaked?**\
**—** You will need to quickly remove/replace the leaked signer address from the paymaster. A leaked signer private key can drain gas funds of the related manager.

**3. As a manager(Dapp), are my funds at risk if private key of un-related signer address is leaked?**\
**—** Only the manager’s gas funds related to the leaked signer address will be at risk. Rest all the manager funds will be safe.

**4. ZKsync processes refunds for extra gas fees paid in each transaction. As a manager, would I be receiving those refunds that is ideally deducted from my balance?**\
**—** Yes, this paymaster solves the refund issue innovatively. Each manager’s balance will be updated with exact refund amount during the **next paymaster interaction.** Hence, all refunds are added back to the respective manager's balance.


# Audits

#### Smart Contract Audit <a href="#smart-contract-auditors" id="smart-contract-auditors"></a>

At Zyfi, ensuring as much security as possible for our users stands at the core of our mission. \
\
Highlighting our dedication to security, Zyfi's permissionles contrat is designed to be immutable, significantly enhancing their appeal for several critical reasons:

* Audits conducted on the smart contracts remain perpetually valid, as the contract is unchangeable and cannot be upgraded
* Users are relieved from the need to monitor for contract alterations that could potentially lead to fund losses or other nefarious consequences
* Such design choice eliminates any possibility for malicious actors to alter the code, or for external pressures (or attacks) to compel a developer to implement unfavourable updates, safeguarding against both cyber and physical threats

The integrity of our smart contract has been rigorously tested both internally and through audits. Please find here a list of the audits that we performed on Zyfi's permissionles paymaster contract:

* Cantina permissionless paymaster [report](https://www.zyfi.org/report-permissionless-paymaster-zyfi.pdf).


# Tokenomics

The ZFI token distribution has been strategically designed to allocate the majority (58%) to the community, recognizing them as the core contributors to the project.

<figure><img src="/files/2qzEn5mxN6UgxQxbUSMM" alt=""><figcaption><p>ZFI Repartition</p></figcaption></figure>

A significant portion of both investors and team members are vested for an extended period to ensure the price evolution aligns with the project's value proposition.

<figure><img src="/files/mzaqqhnJOeHhkBkTkpsC" alt=""><figcaption><p>Vesting Schedule</p></figcaption></figure>

***

**Early Private Investors (17%):**

* **Seed Round (6%):** 5-month lock-up, 3% unlocked 7 days after TGE, followed by 21 months of linear vesting.&#x20;
* **Private (9%):** 4-month lock-up, 3% unlocked 7 days after TGE, followed by 18 months of linear vesting.
* **KOL Round (2%):** No lock-up, 25% unlocked at TGE with 6 months of linear vesting.

**Community Sale (3.75%):**

* Provides the Zyfi community an opportunity to invest: 25% unlocked at TGE, followed by 6 months of linear vesting.

**Founding Team (14%):**

* Builds Zyfi products, drives integrations, and delivers optimal on-chain experiences: 6-month lock-up with 36 months of linear vesting.

**Advisors (5.5%):**

* Provides strategic guidance to support the development of the Zyfi project: 6-month lock-up with 26 months of linear vesting.

**Airdrop (11%):**

* To reward early users of Zyfi products: 29.55% unlocked at TGE, followed by 6 months of linear vesting.

**DAO (33%):**

* Managed by ZFI stakers for strategic decisions, fee activation, and reward allocation: No unlock at TGE, with 120 months of linear vesting.

**Association (8%):**

* Grants for Zyfi builders and partners: No unlock at TGE, with 12 months of linear vesting.

**Liquidity (7.75%):**

* Liquidity reserve for CEX & DEX provision: 50% unlocked at TGE, followed by 6 months of linear vesting.


# Multisigs

To be fully transparent with the community, here are the actual multisigs representing the locked supply of ZFI tokens.

<table><thead><tr><th width="133.06640625">Category</th><th width="93.13671875">Amount</th><th width="167.42578125">Link</th><th>Comments</th></tr></thead><tbody><tr><td>DAO</td><td>165M</td><td><a href="https://debank.com/profile/0x2512a3569f617be0e42dae20651d0f567a9f2216">Debank</a></td><td>Managed by ZFI stakers/holders for strategic decisions, fee activation, and reward allocation.</td></tr><tr><td>Association</td><td>40M</td><td><a href="https://debank.com/profile/0x5ad9af59ae6a0d15fc6de41fc33275f030650761">Debank</a></td><td>Grants for ZyFi builders and partners.</td></tr><tr><td>Treasury</td><td>32M</td><td><a href="https://debank.com/profile/0x274f5c75bf69cca1c4689100bfa57700c98e4927">Debank</a></td><td>Used for liquidity, deployment of products and community initiatives.</td></tr><tr><td>Airdrop</td><td>22.5M</td><td><a href="https://debank.com/profile/0xa71301636bf9878254eb8989031c8adbae7671e8">Debank</a></td><td>Reserved for future airdrop seasons.</td></tr></tbody></table>

Amounts may be updated, as some of these wallets are subject to vesting periods.


# Token Mechanisms

All the details about ZFI and it's value proposition.

{% hint style="info" %}
CA on ZKsync : 0x5d0d7bca050e2e98fd4a5e8d3ba823b49f39868d

CA on Base : 0xD080eD3c74a20250a2c9821885203034ACD2D5ae
{% endhint %}

The **ZFI token** is intrinsically tied to Zyfi’s two core products: [**ZyFAI**](https://www.zyf.ai/) and the [**Zyfi Paymaster**](https://www.zyfi.org/). You can either hold ZFI or stake it as **stZFI**.

The total supply is still [500M ZFI](https://www.coingecko.com/en/coins/zyfai) shared between 2 chains (Base & ZKsync) and you can easily bridge your token from one chain to another [here](https://www.zyf.ai/bridge).

### ZyFAI Mechanism <a href="#zyfai-mechanism" id="zyfai-mechanism"></a>

ZFI is integrated into the ZyFAI product through multiple mechanisms, either already live or subject to DAO governance:

* All yield generated by [treasury wallet](https://debank.com/profile/0xad44FA177e098EDFFa89F778901C6918fF0CCf82) & [DAO Wallet](https://debank.com/profile/0x2512a3569f617be0e42dae20651d0f567a9f2216) could be used for **monthly buybacks** of ZFI. (Subject to DAO vote).
* A **performance fee (10%)** on selected strategies may be redistributed to stakers (Subject to DAO vote).
* **Access to airdrops or exclusive “Degen” strategies** may be gated to VIP stakers (Subject to DAO vote).

<figure><img src="https://docs.zyf.ai/~gitbook/image?url=https%3A%2F%2F2703426568-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FqJ8PULJ0xUAGvx6iYc2k%252Fuploads%252FkxuAlGGG5kClhcLWS7NZ%252FZyfi%2520Token%2520mechanism%2520%284%29.png%3Falt%3Dmedia%26token%3D5782fbc0-8341-49a5-b44e-da390da9dd74&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=9515e03f&#x26;sv=2" alt=""><figcaption><p>ZyFAI token mechanisms</p></figcaption></figure>

### ZyFi Paymaster Mechanism <a href="#zyfi-paymaster-mechanism" id="zyfi-paymaster-mechanism"></a>

Besides all the benefits provided by the ZyFAI product, ZFI is already linked to the Zyfi Paymaster product.

* Stakers gets 33% of the govern total supply through the governance
* Stakers benefit from potential airdrops through Zyfi Partners (e.g. [Heurist](https://x.com/Zyfi_org/status/1865440131697582286)...)
* Stakers can activate fees on Paymaster contracts integrated into over 36 DApps on ZK chains.

<figure><img src="https://docs.zyf.ai/~gitbook/image?url=https%3A%2F%2F2703426568-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FqJ8PULJ0xUAGvx6iYc2k%252Fuploads%252F89m2ZK8WqBpdVh9ILBUP%252FZyfi%2520Token%2520mechanism%2520%283%29.png%3Falt%3Dmedia%26token%3Deac7663a-e837-40bd-83f2-8a7105dca977&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=4d7e3d29&#x26;sv=2" alt=""><figcaption><p>Zyfi token mechanisms</p></figcaption></figure>

Whether held or staked, ZFI offers value across both Zyfi products, with aligned incentives aimed at improving on-chain user experience.


# First Airdrop

To reward early adopters and believers in the Zyfi & Ondefy mission, the 1st season of Airdrop, consisting of 5.5% of the total supply, was conducted.

## **Mechanism**

A simple mechanism with multipliers and eligibility criteria was created to distribute rewards to real users of Zyfi & Ondefy Apps.

* **Zyfi users** received 4.5% of the total supply.
* **Ondefy users** received 1% of the total supply.

## **Eligibility**

To be eligible, users needed to meet one of the following criteria on the snapshot:

* Minimum of 200 gas points in the Zyfi or Ondefy point program
* Perform at least 1 gasless transaction
* Being an Early Power User

The snapshot was taken on October 8th at 1:00 PM UTC.

## **Multipliers 🎉**

Multipliers are additional **bonuses** given to real users in both Zyfi DApp Partners, NFT Partners, Zyfi app & Ondefy app.

For **Zyfi**, these multipliers are designed for people who were heavily involved in the project and the ZKsync ecosystem. Detailed bonuses with associated boosts are provided, rewarding various levels of participation.

<figure><img src="/files/6mrc36YawoRo2O13RMjn" alt=""><figcaption><p>All Zyfi Multipliers</p></figcaption></figure>

**Ondefy** users also get multipliers based on their involvement in the Ondefy app:

<figure><img src="/files/Rdjes6VbIUsbHY8i9oaH" alt=""><figcaption><p>All Ondefy Multipliers</p></figcaption></figure>

At the end, the amount of points you get in the **Zyfi** or **Ondefy** point program is multiplied by these multipliers to give you a final point balance. These final points are then exchanged for ZFI tokens through a specific point-per-token ratio.

For example, a user with **2000** gas points on Zyfi gas point program who meets specific criteria:

* Follows the Zyfi account (**10%**)
* Completes transactions during three distinct months (**30**% + **30**%)
* Hold an Hue NFT (**80**%)

Would have a total of (2000\*150%) + 2000 = **5000** gas points, multiplied by a specific ratio of 0.7 to equal 3500 ZFI tokens. (*These numbers are used as an example*)

> *Note: The Ondefy final point balance was capped at **100,000 points**, and sybil detection was performed to ensure that only real users are rewarded.*

## 100% Bonus

Airdrop-eligible users could also receive a **100% bonus** on their total Airdrop balance. If you directly **stake** your allocation, you can stake all your Airdrop tokens to receive a 100% bonus on your total balance.&#x20;

For example, if you receive **819 ZFI** tokens in the Airdrop, you could stake them to get **1638** stZFI. When you decide to unstake, an unvesting period of 6 months will apply.

<figure><img src="https://cdn-images-1.medium.com/max/1600/1*KANVcmIYhuV9YXQPcY6Ilw.png" alt=""><figcaption></figcaption></figure>

To reward users who will follow us for a long time, this bonus is exclusively reserved for Airdrop Eligible Users!


# DAO

The DAO is a decentralized collective of builders, investors, and believers in the Zyfi and ZyFAI missions to enhance on-chain user experience.

On one hand, the Zyfi project has bootstrapped the project to offer seamless, audited, and flexible solutions such as [ERC20 Paymaster](/integration-guide/paymasters-integration/erc20-paymaster), [Sponsored Paymaster](/integration-guide/paymasters-integration/sponsored-paymaster) and [Permissionless Multi-signer Paymaster](/permissionless-multi-signer-paymaster/about).

On the other hand, the [ZyFAI](https://docs.zyf.ai/) project has built infrastructure for retail users to deploy their own DeFi Agent, which farms the best yields for them across multiple chains.

The core objective of the DAO is to empower the community to shape the future of these infrastructure projects by proposing, debating, and voting on initiatives. A structured governance lifecycle will be implemented to ensure meaningful development aligned with a long-term vision and to prevent spam from bad actors.

The goals are multiple, and all participants in the DAO should understand them:

* **Build a better on-chain experience**: The DAO's primary mission is to deliver the best possible on-chain experience to end users.
* **Development**: As detailed in the mechanism section, the DAO is designed to make users and partners key contributors. Development, new features, and incentives can all be proposed and voted on for implementation.
* **Token value**: The ZFI token and its staked counterpart, stZFI, reflects the value of the Zyfi and ZyFAI ecosystems. The DAO will work to strengthen ZFI’s value through utility-based incentives.

The DAO controls a large portion (33%) of the total ZFI token supply to enhance and push the entire ecosystem for a better user experience on-chain.


# Association

The purpose of the Zyfi Association is to foster innovation, trust, and progress within the Zyfi & ZyFAI protocols by providing funding, resources, and strategic support to contributors, users, and developers.&#x20;

The Association aims to create a scalable, secure, and user-friendly environment that enhances the onchain experience, aligning with the vision of a fully decentralized, community-governed protocol. The Association is entitled to engage in any activity necessary to achieve its purpose.&#x20;

To achieve these aims, the Association's activities may include:&#x20;

* Supporting Contributor with Grants.
* Enabling Developer Participation.
* Promoting Transparent Governance in the framework of open-source principles.&#x20;
* Advancing Decentralization.&#x20;
* Revolutionizing onchain experiences and Trustless Infrastructure.

The Zyfi Association has a no profit purposes. It is politically neutral and denominationally independent. She is based in Vaud, Switzerland in accordance with Art. 60 ff. of the Swiss Civil Code.


# StakeHolder Overview

The DAO is composed of several stakeholders to maintain and ensure proper development and alignment of the project with a long-term vision.

### **Token Holders (stZFI)**

The stZFI token is the staked version of ZFI, offering governance power to all users who hold them. This governance power is proportional to the staked amount. With these tokens, you're able to create and vote on different proposals made through the official forum and snapshot voting system. You can discuss, and vote on topics like fee mechanisms, incentives, and development directions. **The creator of the proposal should at least hold 200k stZFI tokens.**

In terms of responsibilities, each stZFI token holder is encouraged to actively participate in decision-making processes, lending their voice to proposals, discussions, and voting. They are also encouraged to fully understand the implications of their votes by doing their own research to ensure informed decisions.

### **Protectors**

Protectors are members of the Zyfi and ZyFAI communities who understand the technical aspects of paymaster and DeFi Agent and the value proposition of these projects. Periodically, the composition of this group undergoes renewals in which members may join, stay, or leave based on community votes.&#x20;

Protectors have rights and rules to follow:

* Provide feedback and follow proposals.
* Push new ideas that could transition to proposals.
* Protect the Zyfi and ZyFAI products against potential governance takeovers by having the ability to "veto" a proposal.
* Ensure the good execution of proposals.

Protectors are encouraged to be actively involved in discussions on the forum to enhance development and ensure good progress.

Protectors are the owners of this [multisig](https://app.safe.global/home?safe=zksync:0x336044E117fA0e786eE1A58b4a54a9969AA288De).

### **Non-Token Holders**

A user who doesn't hold any stZFI token and is not a protector still has several rights in the DAO, such as discussing, debating, and responding to proposals in the official Zyfi forum. Every person with a good understanding of Account Abstraction domains, DeFi Agent and deep knowledge of its deployment can participate and debate around all subjects proposed in the forum.

Each of these stakeholders is essential to the proper functioning of the DAO.


# Proposal Lifecycle

To ensure structured and effective governance for the DAO, a multi-phase process for proposal submission, review, and approval is implemented. To submit proposal, the creator should at least hold **200k stZFI tokens**. The process will be divided into two main phases: FIRST CHECK, and ZIP (Zyfi Improvement Proposal). Here is the detailed framework for each phase:

#### **Phase 1:  FIRST CHECK**

**Objective:** Verify the interest and feasibility of the proposed idea.

**Process:**

1. **FIRST\_CHECK Submission:**
   * **Format:** Use the FIRST CHECK submission template, including a descriptive title, a brief summary, and an explanation of the motivation.
   * **Forum:** Post the proposal on the Zyfi forum page under the \[FIRST\_CHECK] category.
   * **Link:** Include links to specific ressources if applicable.
2. **Community Discussion:**
   * **Duration:** The proposal must be open for comments for at least 5 days on the forum.
   * **Feedback:** Community members discuss and provide feedback on the proposal.
   * **Validation for Voting:**  If none of the Protectors reject the proposal **before it moves to Snapshot**, it will proceed to the voting phase.
3. **Snapshot Vote:**
   * **Start of Voting:** Voting begins 2 days after the proposal is posted on Snapshot.
   * **Duration:** The vote lasts 5 days.
   * **Voting Options:** Yes, No, Abstain.
4. **Quorum:**
   * **Requirement:** The quorum must reach 1/2 of all staked ZFI tokens at the time of the vote to advance to the ZIP phase. Otherwise, it is excluded. (around 2M stZFI now)

#### **FIRST\_CHECK Template**

```
Title: [FIRST CHECK] Proposal Title
Author: Author Name / Entity
Date: YYYY-MM-DD
Summary: Brief description of the proposal.
Motivation: Why this proposal is necessary and beneficial.
```

#### **Phase 2: ZIP (Zyfi Improvement Proposal)**

**Objective:** Submit the final proposal for an official vote and ensure its implementation if approved.

**Process:**

1. **ZIP Submission:**
   * **Format:** Use the ZIP submission template, including a summary, motivation, detailed specifications, associated costs, and implementation plan.
   * **Forum:** Post the proposal on the Zyfi forum under the \[ZIP] category within 3 days after the FIRST\_CHECK proposal validation.
   * **Review:** If none of the Protectors reject the proposal **before it moves to Snapshot**, it will proceed.
2. **Snapshot Vote:**
   * **Start of Voting:** Voting begins 2 days after the proposal is posted on Snapshot.
   * **Duration:** The vote lasts 5 days.
   * **Voting Options:** Yes, No, Abstain.
3. **Quorum:**
   * **Requirement**: The quorum must reach **half** of all staked ZFI tokens at the time of the vote. (around 2M stZFI now)
   * **Majority**: To be approved, the proposal must receive a majority of "Yes" votes **and** meet the quorum requirement.
   * **Non-Appropriation**: Protectors may not approve their own proposals.
4. **Implementation:**
   * **Execution**: If approved, the proposal will be implemented by the core contributors under the supervision of the Protectors.
   * **Report**: A transparency report will be published to explain the actions taken and justify the implementation.

#### **ZIP Template**

```
Title: [ZIP] Proposal Title
Author: Author Name / Entity
Date: YYYY-MM-DD
Summary: Brief summary of the proposal.
Motivation: Detailed explanation of the proposal and potential benefits.
Specifications: Detailed technical description of the proposed changes.
Costs: Estimated costs associated with the implementation.
Implementation Plan: Details on the implementation, including timeline, contingency plans, and target dates.
FIRST_CHECK Link: [Link to the corresponding FIRST_CHECK proposal]
```


# FAQ

<details>

<summary><strong>What is Zyfi?</strong></summary>

Zyfi is based on a proprietary paymaster that enables gasless transactions for the entire zkSync ecosystem.\
Users can now pay for gas with any ERC-20 token they hold or enjoy sponsored transactions.\
Developers can easily integrate it with our API.

</details>

<details>

<summary><strong>What is the fee model?</strong></summary>

Zyfi operates two different paymaster contracts: the Sponsored Paymaster and the ERC20 Paymaster.

A 20% markup on gas fees applies to transactions processed through the ERC20 Paymaster.

A 25% markup on gas fees applies to transactions processed through the ERC20 Sponsored Paymaster.

Note: This fee is only on gas fees, not swap fees.

</details>

<details>

<summary><strong>Why is Metamask not supported on mobile?</strong></summary>

Metamask mobile does not support the paymaster flow currently.

</details>

<details>

<summary><strong>What is a paymaster?</strong></summary>

A Paymaster is an account that compensates for the transaction fees of other accounts, allowing for fees to be paid in ERC20 tokens instead of ETH by converting them on the fly. This facilitates users who want to interact with protocols without worrying about having ETH for gas fees, enhancing accessibility and usability within the zkSync ecosystem.

</details>

<details>

<summary><strong>What is ZkSync's native Account Abstraction?</strong></summary>

ZkSync is the first EVM-compatible layer 2 that supports account abstraction at the core protocol level. This enables EOAs to send transactions gaslessly on zkSync through any wallet (Metamask, TrustWallet, Rabby, etc.)

</details>


# Contract Addresses

### ZKsync Mainnet Addresses

<table><thead><tr><th width="279">Contract Type</th><th>Addresses</th></tr></thead><tbody><tr><td>ERC20 Paymaster</td><td><a href="https://explorer.zksync.io/address/0xA2Aac7bC9725c36ad9B12D2407dF8de6B2B68359"><code>0xA2Aac7bC9725c36ad9B12D2407dF8de6B2B68359</code></a></td></tr><tr><td>ERC20 Sponsor Paymaster</td><td><a href="https://explorer.zksync.io/address/0x418F8EA78D856bEcf95e08C4A5773F5E85147866"><code>0x418F8EA78D856bEcf95e08C4A5773F5E85147866</code></a></td></tr><tr><td>ERC20 Sponsor Vault</td><td><a href="https://explorer.zksync.io/address/0x32faBA244AB815A5cb3E09D55c941464DBe31496"><code>0x32faBA244AB815A5cb3E09D55c941464DBe31496</code></a></td></tr><tr><td>Permissionless Multi-signer Paymaster</td><td><a href="https://explorer.zksync.io/address/0x68b4F1146a863d0E7cF1e134857411C8a941C86d"><code>0x68b4F1146a863d0E7cF1e134857411C8a941C86d</code></a></td></tr></tbody></table>

### ZKsync Sepolia Testnet Addresses

<table><thead><tr><th width="281">Contract Type</th><th>Addresses</th></tr></thead><tbody><tr><td>ERC20 Paymaster</td><td><a href="https://sepolia.explorer.zksync.io/address/0xEcacba301285cE4308aAFc71319F9a670fdd1C7a"><code>0xEcacba301285cE4308aAFc71319F9a670fdd1C7a</code></a></td></tr><tr><td>ERC20 Sponsor Paymaster</td><td><a href="https://sepolia.explorer.zksync.io/address/0xC530313f1AF0B2B3A41DB2C20D88aF1c93A4f878"><code>0xC530313f1AF0B2B3A41DB2C20D88aF1c93A4f878</code></a></td></tr><tr><td>ERC20 Sponsor Vault</td><td><a href="https://sepolia.explorer.zksync.io/address/0xbA72A10ce8496DC9C13b9eE8c35fcCD3809d3C81"><code>0xbA72A10ce8496DC9C13b9eE8c35fcCD3809d3C81</code></a></td></tr><tr><td>Permissionless Multi-signer Paymater</td><td><a href="https://sepolia.explorer.zksync.io/address/0xc1B0E2edC4cCaB51A764D7Dd8121CBf58C4D9E40"><code>0xc1B0E2edC4cCaB51A764D7Dd8121CBf58C4D9E40</code></a></td></tr></tbody></table>

### Cronos zkEVM Mainnet Addresses

<table><thead><tr><th width="279">Contract Type</th><th>Addresses</th></tr></thead><tbody><tr><td>ERC20 Paymaster</td><td><a href="https://explorer.zkevm.cronos.org/address/0xd7bea05eef5e19723d7ee5f301f455bfd80a2648"><code>0xd7bEA05EEf5E19723d7Ee5f301f455bfD80a2648</code></a></td></tr><tr><td>ERC20 Sponsor Paymaster</td><td><a href="https://explorer.zkevm.cronos.org/address/0xcf11f9b217e32546b47811ffbd6aac0aafe230a3"><code>0xCF11F9B217e32546b47811fFBD6aAC0aaFe230A3</code></a></td></tr><tr><td>ERC20 Sponsor Vault</td><td><a href="https://explorer.zkevm.cronos.org/address/0xef354630b89513015453329ff633663fcf40f85a"><code>0xEF354630B89513015453329ff633663FCf40F85a</code></a></td></tr></tbody></table>

### Cronos zkEVM Testnet Addresses

<table><thead><tr><th width="277">Contract Type</th><th>Addresses</th></tr></thead><tbody><tr><td>ERC20 Paymaster</td><td><a href="https://explorer.zkevm.cronos.org/testnet/address/0xafee0a952a1882f1a55a8076e627408bc9163557"><code>0xafeE0A952A1882F1A55a8076e627408BC9163557</code></a></td></tr><tr><td>ERC20 Sponsor Paymaster</td><td><a href="https://explorer.zkevm.cronos.org/testnet/address/0xfbaa6056db57fe4611be0e394f31fda69e55aed5"><code>0xFbAa6056db57fe4611BE0e394f31Fda69E55aED5</code></a></td></tr><tr><td>ERC20 Sponsor Vault</td><td><a href="https://explorer.zkevm.cronos.org/testnet/address/0xee6e615cf259bdb65dd8c98fec29f7affd732edc"><code>0xEe6e615Cf259bDB65DD8C98fEC29F7aFfD732edC</code></a></td></tr></tbody></table>

### Abstract Mainnet Addresses

<table><thead><tr><th width="277">Contract Type</th><th>Addresses</th><th data-hidden></th></tr></thead><tbody><tr><td>ERC20 Paymaster</td><td><a href="https://abscan.org/address/0xbEd0Ed4C433421363e0394957F352Fe4BF5AF656"><code>0xbEd0Ed4C433421363e0394957F352Fe4BF5AF656</code></a></td><td></td></tr><tr><td>ERC20 Sponsor Paymaster</td><td><a href="https://abscan.org/address/0xe79edf4Ce760F1489dBD430019e2fd25b3487a99"><code>0xe79edf4Ce760F1489dBD430019e2fd25b3487a99</code></a></td><td></td></tr><tr><td>General Flow Paymaster</td><td><a href="https://abscan.org/address/0x1f2b7e7b5B425769B78e5c80f6e3Af9aD1357741"><code>0x1f2b7e7b5B425769B78e5c80f6e3Af9aD1357741</code></a></td><td></td></tr><tr><td>ERC20 Sponsor Vault</td><td><a href="https://abscan.org/address/0x10f81c130564D76d71F705DD82E14817b83f45E3"><code>0x10f81c130564D76d71F705DD82E14817b83f45E3</code></a></td><td></td></tr></tbody></table>

### Abstract Testnet Addresses

<table><thead><tr><th width="278">Contract Type</th><th>Addresses</th></tr></thead><tbody><tr><td>ERC20 Paymaster</td><td><a href="https://sepolia.abscan.org/address/0xafeE0A952A1882F1A55a8076e627408BC9163557"><code>0xafeE0A952A1882F1A55a8076e627408BC9163557</code></a></td></tr><tr><td>ERC20 Sponsor Paymaster</td><td><a href="https://sepolia.abscan.org/address/0xd3eE79A156F59e8b40A2e0A6834F4Fd5229de70D"><code>0xd3eE79A156F59e8b40A2e0A6834F4Fd5229de70D</code></a></td></tr><tr><td>General Flow Paymaster</td><td><a href="https://sepolia.abscan.org/address/0x1ce62Cb4C45339e66b23b8DEb09Fcda43C0Ea692"><code>0x1ce62Cb4C45339e66b23b8DEb09Fcda43C0Ea692</code></a></td></tr><tr><td>ERC20 Sponsor Vault</td><td><a href="https://sepolia.abscan.org/address/0x9f4D380c867EBaed8140C332c78BF32Eb52A01Fb"><code>0x9f4D380c867EBaed8140C332c78BF32Eb52A01Fb</code></a></td></tr></tbody></table>

### Treasure Mainnet Addresses

<table><thead><tr><th width="273">Contract Type</th><th>Addresses</th></tr></thead><tbody><tr><td>ERC20 Paymaster</td><td><a href="https://treasurescan.io/address/0xe79edf4Ce760F1489dBD430019e2fd25b3487a99"><code>0xe79edf4Ce760F1489dBD430019e2fd25b3487a99</code></a></td></tr><tr><td>ERC20 Sponsor Paymaster</td><td><a href="https://treasurescan.io/address/0xC2c573385c1E039B9e4c85e38b2a3D0D0f92917a"><code>0xC2c573385c1E039B9e4c85e38b2a3D0D0f92917a</code></a></td></tr><tr><td>ERC20 Sponsor Vault</td><td><a href="https://treasurescan.io/address/0xbEd0Ed4C433421363e0394957F352Fe4BF5AF656"><code>0xbEd0Ed4C433421363e0394957F352Fe4BF5AF656</code></a></td></tr><tr><td>General Flow Paymaster</td><td><a href="https://sepolia.abscan.org/address/0x1ce62Cb4C45339e66b23b8DEb09Fcda43C0Ea692"><code>0x1ce62Cb4C45339e66b23b8DEb09Fcda43C0Ea692</code></a></td></tr></tbody></table>

### Treasure Testnet Addresses

<table><thead><tr><th width="272">Contract Type</th><th>Addresses</th></tr></thead><tbody><tr><td>ERC20 Paymaster</td><td><a href="https://topaz.treasurescan.io/address/0xafeE0A952A1882F1A55a8076e627408BC9163557"><code>0xafeE0A952A1882F1A55a8076e627408BC9163557</code></a></td></tr><tr><td>ERC20 Sponsor Paymaster</td><td><a href="https://topaz.treasurescan.io/address/0xd3eE79A156F59e8b40A2e0A6834F4Fd5229de70D"><code>0xd3eE79A156F59e8b40A2e0A6834F4Fd5229de70D</code></a></td></tr><tr><td>ERC20 Sponsor Vault</td><td><a href="https://topaz.treasurescan.io/address/0xEe6e615Cf259bDB65DD8C98fEC29F7aFfD732edC"><code>0xEe6e615Cf259bDB65DD8C98fEC29F7aFfD732edC</code></a></td></tr></tbody></table>


# Brand Assets

{% file src="/files/7TM7khZmcM4fGXtQpMCF" %}


# Mobile work-around

To use paymaster transactions on ZKsync, the Viem implementation requires you to `import {eip712WalletActions} from 'viem/zksync'`and extend a `WalletClient` with it.

However, this modifies the `WalletClient.SendTransaction()` function by replacing the `eth_sendTransaction` JSON RPC API method by the `eth_sendRawTransaction` method, which is not supported on several mobile wallets.

The current work-around for making paymaster transactions work with all wallets is to sign the transaction using a `WalletClient`, and then send the signed transaction using a `PublicClient` supporting the eth\_sendRawTransaction. The simplest way is to use a public JSON RPC endpoint, such as <https://mainnet.era.zksync.io>.

#### Classic Paymaster implementation (not compatible with all wallets):

```typescript
  // Paymaster Data received from Zyfi's API
  const pmData = await submitTxDataToAPI(API_URL, dataTxRequest)

  // Extend wallet client to support paymaster transactions
  const wClient = walletClient.extend(eip712WalletActions())

    // Prepare transaction request
    const txReq = await wClient.prepareTransactionRequest({
      account: address,
      to: toAddress,
      value: ETH_AMOUNT,
      chain: zkSync,
      gas: BigInt(pmData.gasLimit),
      gasPerPubdata: BigInt(pmData.txData.customData.gasPerPubdata),
      maxFeePerGas: BigInt(pmData.txData.maxFeePerGas),
      maxPriorityFeePerGas: 0n,
      data: pmData.txData.data,
      paymaster: pmData.txData.customData.paymasterParams.paymaster,
      paymasterInput: pmData.txData.customData.paymasterParams.paymasterInput,
    })

    //  Signs and sends to an endpoint that might be incompatible with eth_sendRawTransaction 
    const hash = await wClient.sendTransaction(txReq)
```

#### Work-around Paymaster Implementation (Works with all wallets)

```typescript
  // Paymaster Data received from Zyfi's API
  const pmData = await submitTxDataToAPI(API_URL, dataTxRequest)

  // Extend wallet client to support paymaster transactions
  const wClient = walletClient.extend(eip712WalletActions())
  
  // Create custom public client with an endpoint that suports eth_sendRawTransaction
  const publicClient = createPublicClient({
    chain: zkSync,
    transport: http('https://mainnet.era.zksync.io')
  })
  
  
  const txReq = await wClient.prepareTransactionRequest({
      account: address,
      to: toAddress,
      value: ETH_AMOUNT,
      chain: zkSync,
      gas: BigInt(pmData.gasLimit),
      gasPerPubdata: BigInt(pmData.txData.customData.gasPerPubdata),
      maxFeePerGas: BigInt(pmData.txData.maxFeePerGas),
      maxPriorityFeePerGas: 0n,
      data: pmData.txData.data,
      paymaster: pmData.txData.customData.paymasterParams.paymaster,
      paymasterInput: pmData.txData.customData.paymasterParams.paymasterInput,
    })
    
    // Sign with Wallet and send signed transaction directly to a compatible endpoint
    const signature = await wClient.signTransaction(txReq)
    const hash = await publicClient.sendRawTransaction({ serializedTransaction: signature })

```

It's a workaround that works perfectly for Dapps wanting to support paymaster functionality on mobile within ZKsync chains.


