-
EnvironmentTestnet Provide a brief description of the functionality you're trying to implement.Paymaster.sol After the basic account registry and module manager feature update, there's a error when a AAtransaction is passed from the paymaster checkvalidationpayment function. The below lines in the paymaster.sol is where the error hits !! address registry = IModuleManager(moduleManager).accountRegistry(); What is the specific issue or error you're encountering?Error: failed paymaster validation. error message: Error function_selector = 0x, data = 0x Can you share the error messages or logs you're receiving, if any?Error message : Have you made any recent changes to the contract before encountering this issue?This is how i'm calling the paymaster contract for a token minting process via the paymaster and the error hits when i run this script which basically calls paymasters validateandpayfortransaction function !!! Is there a problem with the way i'm encoding the paymaster params or ?? There's a similiar approach by porrco-rosso on implementing the account registry and module registry feature with the zksync AA contracts "https://github.com/porco-rosso-j/zksync-account-trade-limit/tree/main/src" const erc20 = getToken(hre, emptyWallet); console.log(gasLimit) console.log( Are there any external libraries or contracts that your contract interacts with?https://github.com/porco-rosso-j/zksync-account-trade-limit/blob/main/src/aa-wallet/AccountRegistry.sol Can you provide the relevant portions of your contract code where the issue is occurring?function validateAndPayForPaymasterTransaction(
Have you tried to isolate the problem, and if so, what were the results?No i couldn't resolve it. What steps have you already taken to try to resolve the issue?Comment the lines in the paymaster which basically check whether the paymaster validateandpayfortransaction function is called a registred module or account !! Repo Link (Optional)No response Additional DetailsThere are 2 external contracts Module manager and Accountregistry contracts features added to the basic AA repo. As the error seems like a function selector error which means the module registry function couldn't be called ?? or sometimes i do get a cannot estimate gas error when the paymaster contract is called from a script !! |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 9 replies
-
Try manually passing the gas params in the transaction overrides when sending the transaction: await (
await erc20.mint(emptyWallet.address, 5, {
// specify gas values
maxFeePerGas: gasPrice,
maxPriorityFeePerGas: 0,
gasLimit: gasLimit,
// paymaster info
customData: {
paymasterParams: paymasterParams,
gasPerPubdata: utils.DEFAULT_GAS_PER_PUBDATA_LIMIT,
},
})
).wait(); |
Beta Was this translation helpful? Give feedback.
-
I have been trying to implement support for adding and removing modules for smart accounts. The paymaster has 2 functions add module and remove. The extra contratcs that i have included in my code is Accountregistry and module manager ( account registry - just maps all the accounts created from the factory and module manager helps with add and removing modules. Inside the validateandpayfortransaction function : address from = address(uint160(_transaction.from)); There is a require statement which checks that the function caller's address is aldready available in the accountregistry or not |
Beta Was this translation helpful? Give feedback.
-
@4NNNN is this is still an issue or can we close this out? |
Beta Was this translation helpful? Give feedback.
-
@4NNNN how did you solve the validation error? im literally getting the same error and I followed the example step by step. |
Beta Was this translation helpful? Give feedback.
-
It seems like there might be an issue with the encoding or decoding of parameters when calling the validateAndPayForPaymasterTransaction function in the Paymaster contract. Specifically, ensure that the parameters passed to the function, such as paymasterInput, are correctly formatted and decoded within the function. Additionally, double-check that the relevant addresses, such as the Paymaster address and token address, are correct and accessible. If you're encountering gas estimation errors, consider adjusting the gas limit parameters or verifying that the contract's state allows for the transaction to be executed successfully within the given gas limits. Finally, for the function selector error, ensure that the correct function signature is being used when calling the Paymaster contract. |
Beta Was this translation helpful? Give feedback.
I don't know the logic you want to implement in your paymaster so I'm sharing a few things to consider:
General
flow instead ofApprovalBased
. Thegeneral
flow does not require atoken
orminimalAllowance
in the paymaster params.You'd need to build a frontend for the smart contract account or just send the transaction from a script. AA unlocks many featur…