10 请问如何通过ethers把一个账户里所有的eth转账走呢 让账户里的eth = 0

我现在的作法是通过 const gasLimit = await provider.estimateGas({from:from,to}); const gasPrice = (await provider.getFeeData()).gasPrice const gas = gasPrice * gasLimit const value = balance - gas 然后使用sendTransaction方法 总是报错 insufficient funds for intrinsic transaction cost

请先 登录 后评论

最佳答案 2024-05-07 11:45

是js做数学运算时产生的精度问题

请先 登录 后评论

其它 4 个回答

Wade - Footprint Analytics CTO
  擅长:数据分析,GameFi,NFT
请先 登录 后评论
吉梦良
请先 登录 后评论
滴滴代打代码
请先 登录 后评论
Wade - Footprint Analytics CTO
  擅长:数据分析,GameFi,NFT
请先 登录 后评论
  • 4 关注
  • 0 收藏,304 浏览
  • 提出于 2024-05-04 18:06

相似问题