From 35dc457d2a66edb4bbeee87e82399f1563afaa14 Mon Sep 17 00:00:00 2001 From: hoshiyari <128719575+hoshiyari420@users.noreply.github.com> Date: Wed, 7 Aug 2024 22:07:55 +0530 Subject: [PATCH] Apply suggestions from code review fix: suggested grammar nits Co-authored-by: Sarah Schwartz <58856580+sarahschwartz@users.noreply.github.com> --- .../permissionless-paymaster/10.index.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/content/tutorials/permissionless-paymaster/10.index.md b/content/tutorials/permissionless-paymaster/10.index.md index d0117f6..1713cd4 100644 --- a/content/tutorials/permissionless-paymaster/10.index.md +++ b/content/tutorials/permissionless-paymaster/10.index.md @@ -28,16 +28,16 @@ You will: ## Project -The similar integration code is [available on GitHub here](https://github.com/ondefy/permissionless-multisigner-paymaster/blob/main/deploy/interact.ts). +A similar version of the integration code is [available on GitHub here](https://github.com/ondefy/permissionless-multisigner-paymaster/blob/main/deploy/interact.ts). ::callout{icon="i-heroicons-exclamation-circle"} -This tutorial does not contain the entire frontend code require for the Dapp. -Instead it covers all the important part required by the Dapp to integrate this paymaster easily. +This tutorial does not contain the entire frontend code required for the Dapp. +Instead it covers just the important parts required by the Dapp to integrate this paymaster easily. :: ## Overview The permissionless multi-signer paymaster serves as a public good, enabling 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. Thus removing the need to deploy paymaster at all. +Dapps can begin utilizing this paymaster by simply depositing funds and adding a signer address. Thus removing the need to deploy a paymaster at all. There are 2 primary actors involved: @@ -46,11 +46,11 @@ There are 2 primary actors involved: **Signers**: Managed by the Dapp or a trusted third party like Zyfi API. A signer’s signature is required to access gas funds by the Dapp’s user. ## Multi-signer -This paymaster allows manager to set multiple signers through which users can have access to the gas funds. Hence, one-to-many relantionship. +This paymaster allows the manager to set multiple signers through which users can have access to the gas funds. Hence, it is a one-to-many relationship. ![manager-signer-relation-diagram](/images/permissionless-paymaster/manager-signer.jpg) ## Integration -Below diagram provides the flow of the integration: +Below the diagram provides the flow of the integration: 1. Dapp decides on custom logic for each user. Let's assume that Dapp decides to sponsor gas for every approve transaction. @@ -71,10 +71,10 @@ deducts gas fees from the manager's balance, and pays for the user's transaction For this tutorial, we will use paymaster deployed on ZKsync sepolia testnet : [0xc1B0E2edC4cCaB51A764D7Dd8121CBf58C4D9E40](https://sepolia.explorer.zksync.io/address/0xc1B0E2edC4cCaB51A764D7Dd8121CBf58C4D9E40#transactions) ## 1. Create a signer -Paymaster will verify signature based on this signer address. -Private key of this signer address should be stored securely by the Dapp. +The paymaster will verify signature based on this signer address. +The private key of this signer address should be stored securely by the Dapp. -- Easy way to create one: +- Here is an easy way to create one: ```javascript import { Wallet } from "zksync-ethers"; @@ -87,13 +87,13 @@ Call `depositAndAddSigner()` function with 0.01 ether and the signer address. ![deposit and add a signer](/images/permissionless-paymaster/depositAndAddSigner.png) ::callout{icon="i-heroicons-exclamation-circle"} -The depositor address is considered "manager". A manager can deposit/withdraw gas funds & add/remove signers at any given time. +The depositor address is considered a "manager". A manager can deposit/withdraw gas funds and add/remove signers at any given time. *A manager can be a signer address too. (not recommended)* :: ## 3. Create function to sign EIP-712 typed paymaster data -This paymaster verifies signature signed by the signer address on the below data. +This paymaster verifies the signature signed by the signer address on the below data. On successful validation, it allows sponsorship for the user using manager's deposited gas funds. ```solidity @@ -110,7 +110,7 @@ On successful validation, it allows sponsorship for the user using manager's dep ); ``` -- Create `getSignature()` function in your backend(recommended) +- Create a `getSignature()` function in your backend(recommended) ```javascript // Example code @@ -229,12 +229,12 @@ const tx = await DappContract.([args..],{ - The gas funds are deducted from the manager's balance related to the signer on successful verification. -- Hence, if signer's private key is leaked, respective manager will need to replace/remove the signer immediately. +- Hence, if a signer's private key is leaked, the respective manager will need to replace/remove the signer immediately. :: -- Adding correct customData(paymasterParams : paymaster address & innerInputs), user shall get signature request pop-up for transaction. -Here user can verify that gas is not being paid from their end and only signature is required. +- Adding correct the `customData(paymasterParams : paymaster address & innerInputs)`, the user shall get a signature request pop-up for transaction. +Here the user can verify that gas is not being paid from their end and only a signature is required. ![transaction](/images/permissionless-paymaster/signatureRequest.png) ::callout{icon="i-heroicons-check-circle"} @@ -242,7 +242,7 @@ Paymaster is successfully integrated. :: ## Refunds -ZKsync refunds ETH to paymaster for the unused gas. +ZKsync refunds ETH to the paymaster for the unused gas. All refunded ETH are added back to the respective manager's balance in the next paymaster transaction. Hence, solving the refund issue for every manager. ## Notes