How do you get the "estimated gas" from a "swapExactETHForTokens" function? As shown in metamask (before one can accept the purchase)
Binance Smart Chain (BSC)
From the pancakeswap contract…
I have a node.js server where I am listening for an event that is emitted from a Solidity smart contract deployed on the Mumbai Polygon testnet.
First, I'm using the "web3-providers-ws" node package to create a provider, using keepalive and…
I'm trying to send transactions to the polygon network using ethers.js. After submitting the transaction, i await tx.wait(), but it fails to resolve 50% of the time. I saw other people were having similar issues but was due to their gas price being…
I'm currently trying to run a test in hardhat/waffle that requires hundreds of unique wallets to call a contract, using new ethers.Wallet.createRandom(). However, none of these wallets are supplied with eth, so I can't call/send transactions with…
I have a smart contract with a receive function :
receive() external payable {
Wallets[msg.sender] += msg.value;
}
I have a front end and I want to send Ethers to this smart contract using the receive() function.
async function transfer()…
I was wondering, what can be done so it would get a balance of specific token I want instead of ethereum?
const getAccountBalance = (account) => {
window.ethereum.request({method: 'eth_getBalance', params: [account, 'latest']})
…
I am new to Smart Contracts.
I am unable to read a smart contract from Binance test network. I keep getting an Unhandled Rejection every time I attempt to read my smart contract using ethers.js.
Error
Unhandled Rejection (Error): invalid fragment…
in React component I want to read function "paused" in contract deployed on Rinkeby testnet. Using useDapp (https://usedapp.io/) hook "useContractCall", i call contract function in custom hook:
import { ethers } from "ethers";
import {…
SyntaxError: Invalid character '\ud835'
When running a web application (built with Typescript + Webpack) inside Safari I am facing the error above (not faced in other browsers).
From searching all node_modules, ethers.js contains:
const EtherSymbol…
I am not really sure how to restart the state of the node to the initial state. Each time I try to redeploy a contract - I'm getting the same contract, the constructor params don't change.
How to clean my local hardhat node?
I want to make a connect to custom network like that at the bottom of arbiscan.io
How would I do this using ethers.js framework?
Clicking the button should add arbitrum network to user's Metamask.
I am using ethers-rs to write a defi app. I need to calculate the CREATE2 address in rust. I couldn't find the equivalent of abi.encodePacked(token0, token1) in rust.
The code used in Uniswap's library…
In ethers.js you can use provider.getGasPrice() to get a best-guess estimate of the gas you should pay. Is there anything simple I can call or transform onto this value in order to get what an equivalent of a "Fast" transaction would be instead of…
When trying to use ethers.utils.parseUnits("1", "ether") in a test function an error is thrown TypeError: Cannot read properties of undefined (reading 'parseUnits').
const { deployments, ethers, getNamedAccounts } = require("hardhat")
const {…