Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit 1af249f

Browse files
authored
improves explanation of innerInput (#169)
1 parent d3aeaf6 commit 1af249f

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

docs/dev/developer-guides/aa.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ function approvalBased(
287287
)
288288
```
289289

290-
The EOA will ensure that the allowance of the `_token` towards the paymaster is set to at least `_minAllowance`. The paymaster is free to interpret the `_innerInput` however it wants to.
290+
The EOA will ensure that the allowance of the `_token` towards the paymaster is set to at least `_minAllowance`. The `_innerInput` param is an additional payload that can be sent to the paymaster to implement any logic (e.g. an additional signature or key that can be validated by the paymaster).
291291

292-
If you are developing a paymaster, you _should not_ trust the transaction sender to honestly behave (e.g. provide the required allowance with the `approvalBased` flow). These flows serve mostly as instructions to EOAs and the requirements should always be double-checked by the paymaster.
292+
If you are developing a paymaster, you _should not_ trust the transaction sender to behave honestly (e.g. provide the required allowance with the `approvalBased` flow). These flows serve mostly as instructions to EOAs and the requirements should always be double-checked by the paymaster.
293293

294294
#### Working with paymaster flows using `zksync-web3` SDK
295295

@@ -299,7 +299,7 @@ The `zksync-web3` SDK provides [methods](../../api/js/utils.md#encoding-paymaste
299299

300300
To let users experience using with paymasters on testnet, as well as to keep supporting paying fees in ERC20 tokens, the Matter Labs team provides the testnet paymaster, that enables paying fees in ERC20 token at a 1:1 exchange rate with ETH (i.e. one unit of this token is equal to 1 wei of ETH).
301301

302-
The paymaster supports only the [approval based](#approval-based-paymaster-flow) paymaster flow and requires that the `token` param is equal to the token being swapped and `minAllowance` to equal to least `tx.maxFeePerErg * tx.ergsLimit`.
302+
The paymaster supports only the [approval based](#approval-based-paymaster-flow) paymaster flow and requires that the `token` param is equal to the token being swapped and `minAllowance` to equal to least `tx.maxFeePerErg * tx.ergsLimit`. In addition, the testnet paymaster does not make use of the `_innerInput` parameter, so nothing should be provided (empty `bytes`).
303303

304304
An example of how to use testnet paymaster can be seen in the [quickstart](./hello-world.md#paying-fees-using-testnet-paymaster) tutorial.
305305

docs/dev/developer-guides/hello-world.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ async getOverrides() {
570570
type: 'ApprovalBased',
571571
token: this.selectedToken.l2Address,
572572
minimalAllowance: fee,
573+
// empty bytes as testnet paymaster does not use innerInput
573574
innerInput: new Uint8Array()
574575
});
575576

docs/dev/tutorials/custom-paymaster-tutorial.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ export default async function (hre: HardhatRuntimeEnvironment) {
384384
token: TOKEN_ADDRESS,
385385
// set minimalAllowance as we defined in the paymaster contract
386386
minimalAllowance: ethers.BigNumber.from(1),
387+
// empty bytes as testnet paymaster does not use innerInput
387388
innerInput: new Uint8Array(),
388389
});
389390

0 commit comments

Comments
 (0)