This repository was archived by the owner on Aug 19, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
wrapper for Approve - Allow #62
Copy link
Copy link
Open
Description
Token Approval Wrapper Function
This structure can be described by two functions:
checkApprovalStatus: Determines if approval is needed.executeApproval: Executes the approval process.
async function approvalWrapper(params) {
if (checkApprovalStatus(params.checkParams)) {
await executeApproval(params.approvalParams);
}
}Implementations:
ERC-20 Tokens:
checkApprovalStatus=allowance: Checks the allowance of tokens.executeApproval=approve: Approves the transfer of tokens.
ERC-721 Tokens (Type 1):
checkApprovalStatus=getApproved: Checks if a specific token is approved.executeApproval=approve: Approves a specific token for transfer.
ERC-721 Tokens (Type 2 - Global Approval):
checkApprovalStatus=isApprovedForAll: Checks if an operator is approved for all tokens.executeApproval=setApprovalForAll: Approves an operator for all tokens.
LockDealNFT Use Case:
checkApprovalStatus=approvedPoolUserTransfers: Checks if a user is approved for pool transfers.executeApproval=approvePoolTransfers: Approves a user for pool transfers.
Metadata
Metadata
Assignees
Labels
No labels