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

Commit

Permalink
docs: update api3-usd-paymaster-tutorial.md (#828)
Browse files Browse the repository at this point in the history
Co-authored-by: amelnytskyi <[email protected]>
  • Loading branch information
MexicanAce and amelnytskyi authored Dec 14, 2023
1 parent 998809b commit f52cfb7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
1 change: 0 additions & 1 deletion docs/.vuepress/sidebar/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export const enSidebar = sidebar({
"/dev/tutorials/custom-aa-tutorial.md",
"/dev/tutorials/aa-daily-spend-limit.md",
"/dev/tutorials/custom-paymaster-tutorial.md",
"/dev/tutorials/api3-usd-paymaster-tutorial.md",
"/dev/tutorials/gated-nft-paymaster-tutorial.md",
]},
],
Expand Down
6 changes: 0 additions & 6 deletions docs/assets/data/devtools.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,6 @@
{
"category": "Oracles",
"tools": [
{
"name": "API3",
"category": "Oracle",
"logo": "api3-logo.webp",
"url": "https://api3.org/"
},
{
"name": "DIA",
"category": "Oracle",
Expand Down
1 change: 0 additions & 1 deletion docs/dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ Our docs are open source so feel free to suggest new topics, add new content, or
- [Account abstraction multisig](./tutorials/custom-aa-tutorial.md): create a native multisig smart contract account.
- [Daily spending limit account](./tutorials/aa-daily-spend-limit.md): create a smart contract account with a daily spending limit.
- [Building a custom paymaster](./tutorials/custom-paymaster-tutorial.md): build a paymaster that allows users to pay gas fees with an ERC20 token.
- [USDC paymaster tutorial with API3](./tutorials/api3-usd-paymaster-tutorial.md): build a paymaster that allows users to pay gas fees with USDC using API3 dAPIs.
- [Gated NFT paymaster](./tutorials/gated-nft-paymaster-tutorial.md): build a paymaster that allows users to pay 0 gas fees when owning a particular NFT.
1 change: 0 additions & 1 deletion docs/dev/tutorials/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Here is the list of tutorials created and maintained by the zkSync DevRel team t
- [Account abstraction multisig](./custom-aa-tutorial.md): create a native multisig smart contract account.
- [Daily spending limit account](./aa-daily-spend-limit.md): create a smart contract account with a daily spending limit.
- [Building a custom paymaster](./custom-paymaster-tutorial.md): build a paymaster that allows users to pay gas fees with an ERC20 token.
- [USDC paymaster tutorial with API3](./api3-usd-paymaster-tutorial.md): build a paymaster that allows users to pay gas fees with USDC using API3 dAPIs.
- [Gated NFT paymaster](gated-nft-paymaster-tutorial.md): build a paymaster that allows users to pay 0 gas fees when owning a particular NFT.

These tutorials were created with the goal of showcasing key features of zkSync Era.
Expand Down
14 changes: 7 additions & 7 deletions docs/dev/tutorials/api3-usd-paymaster-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ head:

# USDC paymaster tutorial with API3 dAPIs

:::Warning
::: warning
This tutorial is currently operational exclusively on the Goerli testnet. Stay tuned for upcoming support for the Sepolia network.
:::

Expand Down Expand Up @@ -45,12 +45,12 @@ API3 data feeds are known as [dAPIs➚](https://docs.api3.org/guides/dapis/subsc

Within a paymaster, price oracles provide price data on-chain for execution.

For this paymaster tutorial, we use dAPIs to get the price of [ETH/USD](https://market.api3.org/dapis/zksync-goerli-testnet/ETH-USD) and [USDC/USD](https://market.api3.org/dapis/zksync-goerli-testnet/USDC-USD) datafeeds, and then calculate gas in USDC value so that users can pay for their transactions with USDC.
For this paymaster tutorial, we use dAPIs to get the price of ETH/USD and USDC/USD datafeeds, and then calculate gas in USDC value so that users can pay for their transactions with USDC.

::: info

- If you want to use an ERC20 token other than USDC, change the dAPIs used in the paymaster.
- For example, if you want to use DAI, use the [DAI/USD](https://market.api3.org/dapis/zksync-goerli-testnet/DAI-USD) dAPI instead of USDC/USD.
- For example, if you want to use DAI, use the DAI/USD dAPI instead of USDC/USD.
:::

## Complete project
Expand Down Expand Up @@ -80,7 +80,7 @@ cd paymaster-dapi
4. Add the project dependencies:

```sh
yarn add -D @matterlabs/zksync-contracts @openzeppelin/contracts @openzeppelin/contracts-upgradeable @api3/contracts
yarn add -D @api3/contracts
```

## Design
Expand Down Expand Up @@ -576,7 +576,7 @@ export default async function (hre: HardhatRuntimeEnvironment) {
To configure your private key, copy the `.env.example` file, rename the copy to `.env`, and add your wallet private key.

```text
WALLET_PRIVATE_KEY=abcdef12345....
PRIVATE_KEY=abcdef12345....
```

### 3. Compile and deploy
Expand All @@ -585,7 +585,7 @@ From the project root, run the following:

```sh
yarn hardhat compile
yarn hardhat deploy-zksync --script deploy-paymaster.ts
yarn hardhat deploy-zksync --script deploy-paymaster.ts --network zkSyncTestnetGoerli
```

The output should be like this (your values will be different):
Expand Down Expand Up @@ -750,7 +750,7 @@ export default async function (hre: HardhatRuntimeEnvironment) {
### 2. Run the script

```sh
yarn hardhat deploy-zksync --script use-paymaster.ts
yarn hardhat deploy-zksync --script use-paymaster.ts --network zkSyncTestnetGoerli
```

The output should look something like this:
Expand Down

0 comments on commit f52cfb7

Please sign in to comment.