You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To resolve the issue of approving to both synapse_cctp and token messenger, follow these steps:
Update approveToken function in /packages/synapse-interface/utils/approveToken.tsx:
Add a check to ensure address and tokenAddress are not zero addresses before calling approveErc20Token.
if(address===zeroAddress||tokenAddress===zeroAddress){thrownewError('Cannot approve to zero address');}
Update approveErc20Token function in /packages/synapse-interface/actions/approveErc20Token.ts:
Add a check to ensure spender and tokenAddress are not zero addresses before proceeding with the approval.
if(spender===zeroAddress||tokenAddress===zeroAddress){thrownewError('Cannot approve to zero address');}
Update approve function in /packages/synapse-interface/utils/actions/approveAndDeposit.tsx and /packages/synapse-interface/utils/actions/approveAndWithdraw.tsx:
Add a check to ensure poolAddress and tokenToApprove are not zero addresses before calling approveToken.
if(poolAddress===zeroAddress||tokenToApprove===zeroAddress){thrownewError('Cannot approve to zero address');}
These changes will prevent approvals to zero addresses and avoid reverts.
Currently, we approve to both, so if one is not set we get a revert on 0 addresses.
Also should not try to approve at all to 0 address
The text was updated successfully, but these errors were encountered: