[General] Cannot use 2 or more parameters in the paymaster's innerInput data #148
-
EnvironmentTestnet Provide a brief description of the functionality you're trying to implement.I am trying to deploy a custom paymaster implementation that verify a second signature by passing data to the innerInput. What is the specific issue or error you're encountering?I can pass one parameter (e.g. the expiration timestamp), but I receive the error below if I try to add more Can you share the error messages or logs you're receiving, if any?
Have you made any recent changes to the contract before encountering this issue?N/A Are there any external libraries or contracts that your contract interacts with?No Can you provide the relevant portions of your contract code where the issue is occurring?Test fileconst innerInput = ethers.utils.solidityPack(["uint256", "bytes"], [expiration, SignedMessageHash]);
const paymasterParams = utils.getPaymasterParams(
paymaster.address.toString(),
{
type: payType,
token: token,
minimalAllowance,
innerInput: innerInput,
}
);
console.log("Paymaster params: ", paymasterParams);
await (
await erc20.connect(userWallet).mint(user.address, 5, {
maxPriorityFeePerGas: ethers.BigNumber.from(0),
maxFeePerGas: gasPrice,
gasLimit: GAS_LIMIT,
customData: {
paymasterParams: paymasterParams,
gasPerPubdata: utils.DEFAULT_GAS_PER_PUBDATA_LIMIT,
},
})
).wait();
} Solidityif (paymasterInputSelector == IPaymasterFlow.approvalBased.selector) {
// While the transaction data consists of address, uint256 and bytes data,
// the data is not needed for this paymaster
(address token, uint256 amount, bytes memory data) = abi.decode(
_transaction.paymasterInput[4:],
(address, uint256, bytes)
);
// Unwrap the data
(uint256 expiration, bytes memory signedMessage) = abi.decode(
data,
(uint256, bytes)
); Have you tried to isolate the problem, and if so, what were the results?I tried using different parameters, but I always get an error with 2+ parameters. What steps have you already taken to try to resolve the issue?I am running the in-memory node Repo Link (Optional)No response Additional DetailsNo response |
Beta Was this translation helpful? Give feedback.
Answered by
dutterbutter
Oct 3, 2023
Replies: 4 comments 4 replies
-
Thanks for posting!! Let me reproduce on my side and I will follow up. |
Beta Was this translation helpful? Give feedback.
4 replies
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
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
Hey @lutr0 - thanks for posting these great questions. Please keep them coming 💪
I was able to pass in two params using the following example:
And then on the contract side: