dariobuzz
dariobuzz
I fixed with bigNumber function calculate_gas_price(action, amount){ console.log("amount",amount); if (action==="buy"){ const data=ethers.utils.formatUnits(amount.add(1000000000), 'wei') return ethers.BigNumber.from(data.toString()) }else{ const data=ethers.utils.formatUnits(amount.sub(1000000000), 'wei') return ethers.BigNumber.from(data.toString()) } }
I fixed with bigNumber function calculate_gas_price(action, amount){ console.log("amount",amount); if (action==="buy"){ const data=ethers.utils.formatUnits(amount.add(1000000000), 'wei') return ethers.BigNumber.from(data.toString()) }else{ const data=ethers.utils.formatUnits(amount.sub(1000000000), 'wei') return ethers.BigNumber.from(data.toString()) } }
same issue 'UNPREDICTABLE_GAS_LIMIT', how can I fix it?