Skip to content

[SDK] <Title> Javascript SDK: Unable to use testnet paymaster contract, always paid by ETH #150

Closed Answered by dutterbutter
enochSatis asked this question in SDKs
Discussion options

You must be logged in to vote

@enochSatis actually I see the issue! I was able to successfully run this and pay with DAI.

The issue is you are using ethers.Wallet rather than the our sdks Wallet. So try this:

import { Provider, utils, Wallet } from "zksync-web3";
import * as ethers from "ethers";
import { HardhatRuntimeEnvironment } from "hardhat/types";

// load env file
import dotenv from "dotenv";
dotenv.config();

// load contract artifact. Make sure to compile first!
import * as ContractArtifact from "../artifacts-zk/contracts/Greeter.sol/Greeter.json";

const PRIVATE_KEY = process.env.WALLET_PRIV_KEY || "";

// Pay in DAI on testnet
const PAYMASTER_TOKEN_ADDR = "0x3e7676937A7E96CFB7616f255b9AD9FF47363D4b";
conso…

Replies: 4 comments 8 replies

Comment options

You must be logged in to vote
8 replies
@enochSatis
Comment options

@dutterbutter
Comment options

@enochSatis
Comment options

@dutterbutter
Comment options

Answer selected by dutterbutter
@enochSatis
Comment options

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
SDKs
Labels
sdk Questions for the SDKs aa Question related to Account Abstraction
5 participants