-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support for Paymasters #95
Comments
We'd be softly interested in adding this feature depending on how much support can be provided in terms of notes on integration points. Are you able to provide more details on this? |
Checking with @IAvecilla who has recently contributed to the paymaster example in the lib. Is this feature now complete and tested? |
Since no response to my previous comments, I would like to tag @ischasny in case he'd be able to update this ticket. We are currently running into an issue in interacting with a paymaster that is setup by ZyFi. We get the paymaster params from the ZyFi's api server and use the following code snippet that is based upon the latest zksync-web3-rs to make our paymaster transaction: info!(response = ?response, "ZyFi Response");
let chain_id = response.tx_data.chain_id;
let from = parse_ethereum_address(&response.tx_data.from)?;
let to = parse_ethereum_address(&response.tx_data.to)?;
let data = hex::decode(response.tx_data.data)?;
let value = parse_u256(&response.tx_data.value)?;
let paymaster =
parse_ethereum_address(&response.tx_data.custom_data.paymaster_params.paymaster)?;
let paymaster_input = hex::decode(
response
.tx_data
.custom_data
.paymaster_params
.paymaster_input,
)?;
let gas_per_pubdata = response.tx_data.custom_data.gas_per_pubdata;
let gas_limit = response.tx_data.gas_limit;
let max_fee_per_gas = parse_u256(&response.tx_data.max_fee_per_gas)?;
Ok(Eip712TransactionRequest::new()
.from(from)
.to(to)
.data(data)
.custom_data(
Eip712Meta::new()
.paymaster_params(PaymasterParams {
paymaster,
paymaster_input,
})
.gas_per_pubdata(gas_per_pubdata),
)
.chain_id(chain_id)
.gas_limit(gas_limit)
.max_fee_per_gas(max_fee_per_gas)
.value(value))
} When this transaction is delivered the response is:
Since we do not have such an issue when interacting with the same paymaster in our other non-rust apps, our main suspicion is the paymaster support in zksync-web3-rs may have an issue, hence our interest in the fate of this ticket. |
Hi team, I am working with Zyfi to identify the root cause mentioned here by @aliXsed. The error may suggest it is the paymaster validation here but it's not. The error here is that the paymaster_input should be a hex string but it's being sent as uint array because of which the validation fails on the paymaster.
Please do look into this! |
Add support for using paymasters with EIP712 trasnsactions.
Useful links:
The text was updated successfully, but these errors were encountered: