Permit Operations
This section covers the permit functionality for gasless token approvals.
permitAndCall
Executes a permit and then performs an action in a single transaction.
function permitAndCall(bytes permit, bytes action) external payable
Parameters
permit
(bytes): The permit data for token approvalaction
(bytes): The action to execute after the permit
Description
This function allows users to approve tokens and execute an action in a single transaction. This is useful for gasless interactions where users sign permits off-chain.
Example
// Execute permit and action in one transaction
await papayaContract.permitAndCall(permitData, actionData, {
value: ethers.utils.parseEther("0.1")
});
Related Errors
WrongSignature: When permit signature is invalid
DeadlineExceeded: When permit has expired
Permit2TransferAmountTooHigh: When permit2 transfer amount is too high
Last updated