From fd860f6dad228b16ca667d87e906510b0b898670 Mon Sep 17 00:00:00 2001 From: zhl Date: Tue, 6 Jun 2023 14:48:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=AE=A1=E7=AE=97erc20?= =?UTF-8?q?=E8=BD=AC=E8=B4=A6gas=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chain/ERC20Reactor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chain/ERC20Reactor.ts b/src/chain/ERC20Reactor.ts index fa4aea5..e20645a 100644 --- a/src/chain/ERC20Reactor.ts +++ b/src/chain/ERC20Reactor.ts @@ -148,8 +148,8 @@ export class ERC20Reactor { } let gasEstimate = from === this.account.address - ? await contract.methods.transfer(to, 0).estimateGas() - : await contract.methods.transferFrom(from, to, 0).estimateGas() + ? await contract.methods.transfer(to, amountBN).estimateGas() + : await contract.methods.transferFrom(from, to, amountBN).estimateGas() if (estimate) { return gasEstimate }