[SDK] <Title> Javascript SDK: Unable to use testnet paymaster contract, always paid by ETH #150
-
EnvironmentTestnet Acknowledgement
Issue DescriptionBackground settingI am following the tutorial for using the testnet paymaster with Javascript SDK: https://era.zksync.io/docs/dev/building-on-zksync/hello-world.html#paying-fees-using-testnet-paymaster And also the example codes on gitHub: https://github.com/matter-labs/paymaster-examples/blob/main/contracts/test/erc20fixed.test.ts I have deployed the demo My procedure
ProblemNo matter how I tried, the transaction will success but the gas is always paid with ETH. Expected BehaviorI tried the following modifications, but the transaction will always be paid with ETH:
Code ExampleMy code is a modification of the demo use-greeter.ts
package.json
Repo Link (Optional)No response |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
Thanks for the very well documented issue. The setup looks correct at first glance, what rpc are you connecting to in your hardhat config (e.g. |
Beta Was this translation helpful? Give feedback.
@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 sdksWallet
. So try this: