Paymaster validation error
infra403 opened this issue Β· comments
π Bug Report for zksync2-js JavaScript SDK
π Description
Encountering errors when paying gas with Paymaster
π Reproduction Steps
const paymasterAddress = "0xf2a173643ca958213714712ce195f6f6e9c686e7"
paymasterParams = utils.getPaymasterParams(paymasterAddress, {
type: "ApprovalBased",
token: gasPayTokenAddress,
minimalAllowance: ethers.constants.MaxUint256,
innerInput: "0x0000000000000000000000000000000000000000000000000000000000000001",
});
let populatedTx = {
from: wallet.address,
data: swapDataHex,
to: newRouteAddr,
// gasPrice: gasPrice,
gasLimit: 1000000,
// type: EIP712_TX_TYPE;
value: ethers.BigNumber.from(0),
customData: customData
}
const response = await wallet.sendTransaction(populatedTx);
result = await response.wait();
π€ Expected Behavior
Paying gas with Paymaster
π― Current Behavior
processing response error (body="{"jsonrpc":"2.0","error":{"code":3,"message":"failed to validate the transaction. reason: Validation revert: Paymaster validation error: Error function_selector = 0x, data = 0x","data":"0x"},"id":94}", error={"code":3,"data":"0x"}, requestBody="{"method":"eth_sendRawTransaction","params":[""],"id":94,"jsonrpc":"2.0"}", requestMethod="POST", url="", code=SERVER_ERROR, version=web/5.7.1),
π₯οΈ Environment
- Node version: [v20.0]
- Operating System & Version: [docker]
- Other relevant environment details: zksync-ethers@5.3.0
π Additional Context
π Log Output
processing response error (body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":3,\"message\":\"failed to validate the transaction. reason: Validation revert: Paymaster validation error: Error function_selector = 0x, data = 0x\",\"data\":\"0x\"},\"id\":94}", error={"code":3,"data":"0x"}, requestBody="{\"method\":\"eth_sendRawTransaction\",\"params\":[\"\"],\"id\":94,\"jsonrpc\":\"2.0\"}", requestMethod="POST", url="", code=SERVER_ERROR, version=web/5.7.1),
This issue is not related to the SDK itself. There is a discussion about this error available here. Also zksync2-js
has been deprecated, please switch to zksync-ethers
.