I am trying to estimate gas using ethers. I have tred using await this.signer.getGasPrice() but this doesn't take into account my contract's function and my address.I saw that on ethers's documentation they have a function
await provider.estimateGas({ // Wrapped ETH address
to: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // `function deposit() payable`
data: "0xd0e30db0", // 1 ether
value: parseEther("1.0") });
but this takes transaction data as an input?
How am I supposed to get tranaction data prior to submitting a transaction?
[link] [comments]
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments