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.

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, PancakeSwap and Gravita.

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.

Flow 2: The transaction is sponsored

Our 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, PancakeSwap, Zyfi front-end and zkMarket.

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

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.

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

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

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.

Last updated