Experience the magic of paymasters with our simple dApp demonstration!
The repository gives you a simplified frontend that interacts with smart contracts deployed on the zkSync Era. Notably, users can deploy a Greeter, NFT, and Paymaster contract where users possessing a particular NFT can have their gas fees paid by the paymaster. 🌍
The repository is divided into two key sections:
-
/zksync
: This is where the smart contracts are located. You'll findGreeter.sol
,ERC721.sol
, andERC721GatedPaymaster.sol
within. -
/frontend
: Here you'll find the frontend developed using React and Next.js. This frontend helps you interact with the smart contracts.
Make sure that you have sufficient funds in your wallet. Also, ensure that the zkSync Testnet is available and that MetaMask is installed.
Update the .env-example
in zksync/
directory with your wallet private key to deploy the contracts.
Let's jump right in:
-
Install Dependencies
First off, install the dependencies:
yarn install
-
Compile Contracts
Compile the contracts:
yarn compile:contracts
-
Deploy Contracts
Deploy the
ERC721.sol
,Greeter.sol
, andERC721GatedPaymaster.sol
contracts:yarn deploy:contracts
Important: During the deployment process, you will be prompted to provide a Recipient Address. This is the address where the newly minted NFT will be sent.
This will run the deployment scripts in
/zksync/deploy
. -
Serve the User Interface
Excellent! Now that our contracts are deployed, we can serve up the user interface and interact with these contracts. To do so:
yarn serve:ui
This command starts the Next.js server on
localhost:3000
.
Here are some handy commands to get you started:
yarn compile:contracts
: Compiles the contracts.yarn deploy:contracts
: Deploys all contracts.yarn deploy:greeter
: DeploysGreeter.sol
contract. Find deployment scripts in the/contracts/deploy
directory.yarn deploy:nft
: DeploysERC721.sol
contract. Deployment scripts are in the/contracts/deploy
directory.yarn deploy:paymaster
: DeploysERC721GatedPaymaster.sol
contract. You can find deployment scripts in the/contracts/deploy
directory.yarn serve:ui
: Launches the frontend onlocalhost:3000
.
For more information and support, visit our official channels:
Jump in, and let's make the most of paymasters together! 🚀