|
|
|
@ -215,7 +215,9 @@ async function estimateGas ({ |
|
|
|
|
// if recipient has no code, gas is 21k max:
|
|
|
|
|
if (!selectedToken && !data) { |
|
|
|
|
const code = Boolean(to) && await global.eth.getCode(to) |
|
|
|
|
if (!code || code === '0x' || code === '0x0') { // Infura will return '0x', and ganache-core v2.2.1 will return '0x0'
|
|
|
|
|
// Geth will return '0x', and ganache-core v2.2.1 will return '0x0'
|
|
|
|
|
const codeIsEmpty = !code || code === '0x' || code === '0x0' |
|
|
|
|
if (codeIsEmpty) { |
|
|
|
|
return SIMPLE_GAS_COST |
|
|
|
|
} |
|
|
|
|
} else if (selectedToken && !to) { |
|
|
|
|