修正计算erc20转账gas计算错误的bug

This commit is contained in:
zhl 2023-06-06 14:48:25 +08:00
parent c55860b023
commit fd860f6dad

View File

@ -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
}