# UI Ideas

## 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="https://3129085131-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ffg3zJM5ChpTTMyke744p%2Fuploads%2Fq42vdmGVUyKqacRiH5Jr%2FUntitled-2024-02-17-1425.png?alt=media&#x26;token=c90dd1b0-063e-4e1d-9b7a-a9cf6427a4a3" 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="https://3129085131-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ffg3zJM5ChpTTMyke744p%2Fuploads%2FQ0HskhXS2jT8gG4prIeu%2FSlice%207%20(3).png?alt=media&#x26;token=fb3dc496-7156-4fcb-889b-522603f22286" 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="https://3129085131-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ffg3zJM5ChpTTMyke744p%2Fuploads%2FfLBuKHBwoijujR4g6neu%2FUntitled-2024-02-17-1425.png?alt=media&#x26;token=f5826fe2-f2ed-4565-b31f-1eec248be898" alt=""><figcaption><p>Example from Gravita Protocol</p></figcaption></figure>

### Selection from the widget

At [Zyfi](https://docs.zyfi.org/introduction),  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="https://3129085131-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ffg3zJM5ChpTTMyke744p%2Fuploads%2Fuj6cuXOPNhyRN56me4ez%2FCapture%20d%E2%80%99e%CC%81cran%202024-08-14%20a%CC%80%2011.23.41.png?alt=media&#x26;token=644cdf1b-4c69-4b90-8da3-af9ea7b98fa1" 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](https://docs.zyfi.org/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="https://3129085131-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ffg3zJM5ChpTTMyke744p%2Fuploads%2FA9Z6J1AaRzKhw6JYvrJX%2FSlice%208%20(2).png?alt=media&#x26;token=4d7c79ef-319f-4d1b-bfa5-235aafc830c5" 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="https://3129085131-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ffg3zJM5ChpTTMyke744p%2Fuploads%2FyjNOgaBe9FFYg8nJ9RcF%2FCapture%20d%E2%80%99e%CC%81cran%202024-08-14%20a%CC%80%2011.02.17.png?alt=media&#x26;token=025b0681-1d74-4b37-8b17-9d61894e8798" 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="https://3129085131-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ffg3zJM5ChpTTMyke744p%2Fuploads%2FyNqLllFkH3OskWMCdXlB%2FCapture%20d%E2%80%99e%CC%81cran%202024-08-14%20a%CC%80%2011.32.56.png?alt=media&#x26;token=9ad90607-1b71-41fb-9108-7eb0c14e3a49" 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="https://3129085131-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ffg3zJM5ChpTTMyke744p%2Fuploads%2FaDoOFmhEfTKp4oQ25RbR%2FCapture%20d%E2%80%99e%CC%81cran%202024-08-14%20a%CC%80%2011.30.53.png?alt=media&#x26;token=bc905c70-f6b9-4f3b-85f9-15cd46212e0f" 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="https://3129085131-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ffg3zJM5ChpTTMyke744p%2Fuploads%2FpQJH0nXjaRkycYG25Ckx%2FCapture%20d%E2%80%99e%CC%81cran%202024-08-14%20a%CC%80%2011.37.47.png?alt=media&#x26;token=96d0bd08-062c-437c-9d3a-5a0b3e60bf4d" alt=""><figcaption><p>A Frenzy Frog holder accesses the zkMarket front-end</p></figcaption></figure>
