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
Withdrawing native tokens from to a smart account throws unpredictable gas error. This is preventing our users to use 1Inch API to swap ERC tokens into Native tokens.
Digging more into this I've created a minimal code to reproduce the issue, by trying to unwrap WMATIC tokens for MATIC on Mumbai:
import{config}from"dotenv"import{AbstractWallet,PrivateKeyWallet,SmartWallet,SmartWalletConfig}from"@thirdweb-dev/wallets";import{Mumbai}from"@thirdweb-dev/chains";import{ThirdwebSDK}from"@thirdweb-dev/sdk";import{utils}from"ethers";import{WETH_ABI}from"./ABI/weth";config()asyncfunctionwithdraw(wallet: AbstractWallet){constsdkSmart=awaitThirdwebSDK.fromWallet(wallet,Mumbai);constwmaticAddress="0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889";constwmaticContract=awaitsdkSmart.getContract(wmaticAddress,WETH_ABI)constdata=awaitwmaticContract.call('withdraw',[utils.parseEther('0.1')])console.log('data: ',data)}asyncfunctioncreateTransaction(){console.log("creating account")constprivateKey=process.env.PRIVATE_KEYasstring;constpersonalWallet=newPrivateKeyWallet(privateKey);console.log("personalWallet: ",awaitpersonalWallet.getAddress());constconfig: SmartWalletConfig={chain: Mumbai,factoryAddress: process.env.FACTORY_ADDRESSasstring,secretKey: process.env.SECRET_KEYasstring,gasless: true,// enable or disable gasless transactions};constsmartWallet=newSmartWallet(config);awaitsmartWallet.connect({
personalWallet,});console.log("smartWallet: ",awaitsmartWallet.getAddress());console.log("Unwrapping with personal wallet")awaitwithdraw(personalWallet)console.log("Unwrapping with smart wallet")awaitwithdraw(smartWallet)}createTransaction()
I've tested this script with our version of contract factory (v1.4.0) and the latest one available (v1.5.3), which strangely enough throw a different error in this case:
Managed Account Factory v1.4.0
Reason: Error: gas required exceeds allowance
Managed Account Factory v1.5.3
Reason: execution reverted
The text was updated successfully, but these errors were encountered:
Withdrawing native tokens from to a smart account throws unpredictable gas error. This is preventing our users to use 1Inch API to swap ERC tokens into Native tokens.
Digging more into this I've created a minimal code to reproduce the issue, by trying to unwrap WMATIC tokens for MATIC on Mumbai:
I've tested this script with our version of contract factory (v1.4.0) and the latest one available (v1.5.3), which strangely enough throw a different error in this case:
Managed Account Factory v1.4.0
Managed Account Factory v1.5.3
The text was updated successfully, but these errors were encountered: