I created a contract instance in hardhat console like so:
const contract_fac = await ethers.getContractFactory("ContractName");
const contract = await contract_fac.attach("CONTRACTADDR...");
Contract object has all public/external functions except…
Problem
I am trying to use a method of a contract on the test network (ropsten), but it fails due to this error:
reason: 'cannot estimate gas; transaction may fail or may require manual gas limit',
code: 'UNPREDICTABLE_GAS_LIMIT'
Code
I created an…
I'm trying to call a payable function on a smart contract that only accepts one argument.
How would I send an eth value to this function in ethers.js along with the function call? The docs don't seem to give much examples on the best way to do…
When running tests and scripts, all functions are called by the first address provided by Hardhat.
I'd like to know if there's a way to change the calling address within the same test or script.
Thanks in advance!
I'm trying to fetch the price of ETH from KyberSwap, using Ethers.js, but I'm receiving the following error:
Error: unknown account #0 (operation="getAddress", code=UNSUPPORTED_OPERATION, version=providers/5.5.3)
I'm connected to an Infura web…
I am getting the
Property 'ethereum' does not exist on type 'Window & typeof globalThis'
error in React. This is the line generating the issue:
import { ethers } from 'ethers'
const provider = new…
I am trying to verify my contract with arguments and I am getting this error:
Error in plugin @nomiclabs/hardhat-etherscan: The contract verification failed.
Reason: Fail - Unable to verify
I am also importing Open Zeppelin contracts…
I am writing an NFT smart contract which I am going to test via Hardhat and deploy on RSK.
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
contract MyNFT…
I have an ethers contract that I've made a transaction with:
const randomSVG = new ethers.Contract(RandomSVG.address, RandomSVGContract.interface, signer)
let tx = await randomSVG.create()
I have an event with this transaction:
function create()…
I am trying to send ETH to a contract function from a web app via metamask and ethers.js. So far I have tried:
const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();
const splitterManager = new…
I can't understand what the problem is. When I am run the app I am getting this error:
Unhandled Runtime Error
Error: invalid address or ENS name (argument="name", value=5.050201689117535e+47, code=INVALID_ARGUMENT, version=contracts/5.5.0)
My code…
I am new to deploying smart contracts with hardhat and am following a tutorial at https://dev.to/dabit3/the-complete-guide-to-full-stack-ethereum-development-3j13. However, after running npx hardhat run scripts/deploy.js --network localhost, I get…
According to official docs of ethers.js, this should be the way how to connect to a specific network like Rinkeby-testnet with custom data:
const provider = ethers.getDefaultProvider(network, {
etherscan: ETHERSCAN_API_KEY,
infura:…
Can somebody please point me to the documentation (official or otherwise ) that explains the function ethers.getContractAt():
the original context of this is as follows:
vrfCoordinator = await ethers.getContractAt('VRFCoordinatorMock',…