Skip to content
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

[v0.32.0] loadApprovalStatusForOrder still forcing user to choose custom spending cap #106

Open
tyh-dev opened this issue Jun 29, 2023 · 2 comments

Comments

@tyh-dev
Copy link

tyh-dev commented Jun 29, 2023

I just upgraded to v0.32.0 and read the release notes. I thought it was supposed to now set the minimal viable approval now but I still get MetaMask asking to set a custom spending cap for WETH or choose max.

Screenshot 2023-06-29 at 4 11 18 AM

Here is part of my code for V4 SDK:

const approvalStatusForTaker = await swapSdkV4?.loadApprovalStatusForOrder(order_data, 'TAKER');

if (!approvalStatusForTaker?.contractApproved) {
    const approvalTx = await swapSdkV4?.approveTokenOrNftByAsset(ethToSwapTaker, walletAddressTaker);
    const approvalTxReceipt = await approvalTx?.wait();
}

Is this supposed to happen? It seems the same as the previous release. Thanks!

@wizardlabsxyz
Copy link

Facing the same issue here, although i'm using V3 of the SDK. It looks like if the user approves anything other than default i.e. a custom amount or using MAX, the return value from loadApprovalStatus still returns false.

@castrolol
Copy link

which ERC20 are you guys using? I had this issue, with USDT, and I notice that they have a different way to manage approval, with a spending cap and the allowance returns a number instead of a flag, for this case I used the contract directly to check the remaining spending cap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants