Category "ethers.js"

How to write typescript interface for Window object ethereum that has a request method being called

I am running the following function import { ethers } from "ethers"; async function requestAccount() { await window.ethereum.request({ method: "eth_reques

How to restart a local hardhat node to initial state?

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 cons

how to make discord bot to get user eth address and store them in database?

i need to make a very simple discord bot to verify and show eth address and show which user it belongs too. Need to associate a verified eth address for each m

Set transaction in metamask with api call using react js

I use TatumIO for creating NFT mp, this thing provides you to use api calls to make transactions like mint, sell, buy, create etc. A little explanation before q

Ethers.js event listeners - Expected behavior for many getLogs/chainId/blocknumber requests?

I'm building a minting site that requires me to check the number of NFTs minted and display that number in real time to the user. At first I was just making a r

Transaction reverted: function selector was not recognized and there's no fallback function

I am interacting with my own smart contract. It's a very simple one. // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract ERC20 { string public n

ENS: NameChanged() event not triggered

Intro I'm creating a dapp that uses ens. The ens should be automatically displayed for every wallet that owns it. For this I'm using the provider.lookupAddress(

Hardhat – What are the strange calls to my smart contract?

I am using Hardhat hackathon boilerplate and calling my smart contract's (address 1c0, addresses shortened for clarity) function MyContract#addProduct from the

How to extract image URL from ens avatar text record

When using ethers JavaScript library to retrieve ENS text records from the Ethereum Name Service. I got the NFT URI from the text record but not the image URL.

How do I reset Hardhat's mainnet fork between tests?

I'm writing unit tests in Hardhat using Hardhat's mainnet fork, however it seems that the results from one test are affecting future tests and causing my assert

Verify the contract from a contract factory

I am learning about web3 and using web3-react, ethers and hardhat. I made a contract, and I want that every user deploys their own Contract. The Contract is dep

Passing a Struct Array to constructor of Solidity Contract

I am building an NFT smart contract with solidity, and I am trying to pass and Array of Structs into the constructor when I deploy the contract. However I am ge

How to get ens username using ensjs

On the ensjs README, I see this code snippet: import ENS, { getEnsAddress } from '@ensdomains/ensjs' const ens = new ENS({ provider, ensAddress: getEnsAddres

Error in plugin @nomiclabs/hardhat-etherscan: The contract verification failed. Reason: Fail - Unable to verify - with arguments

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. Re

ethers js exits with this error=> invalid BigNumber value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.5.0)

I tried to send a request to my contract using ethersjs like this: const web3Modal = new Web3Modal() const connection = await web3Modal.connect(