Category "ethers.js"

How to get the returned data from a smart contract function using ethers.js?

I'm trying to consume a function from a smart contract using ethers.js. The function retrieve the info of a user logged before (with the help of other function)

Ethers.js returns the same wallet address even if I switch accounts

I'm using Ethers.js to allow users to connect their Metamask wallets to my app. Here's the code that I have: import { ethers } from "ethers" async function con

Not getting event from smart contract on ethers.js

I have contract this part is simply creating smart contract for NFT. At the end of the createToken() I am emitting event. // SPDX-License-Identifier: MIT OR Apa

How to connect a Chrome extension made with React to Metamask and other wallets?

I need to connect Metamask to a Chrome extension I'm doing. I'm not a crypto expert, I'm using ethers js and following some tutorials but the extension doesn't

How to verify message in wallet connect with ethers primarily on ambire wallet?

I am trying to sign a message with wallet connect using ethers, but I am facing an issue when verifying the message with ambire wallet, it's not returning any r

Ethers.js: Solidity method arguments of type "contract": Error: invalid address or ENS name

I'm trying to invoke the following solidity function from ethersjs (it takes another contract as argument): function getReservesData(IPoolAddressesProvider prov

How to send a web3 or ethers transaction to bsc using javascript from back end?

I would like to send a transaction to the binance smart chain (BSC)that will buy an NFT for a crypto integrated game. I've looked at their contract to figure ou

ethers can't get pure function return value

I built a test solidity pure function to display a greeting message. It only returns a string "Hello User". Here is the contract code: //SPDX-License-Identifie

How to deploy multiple smart contracts using hardhat-deploy

I have two smart contracts that I want to deploy. I want to deploy the first one, then pass the address of the first into the constructor of the second one. I a

How to send ETH to a contract function with ethers.js?

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

Ethers.js "Error: unknown account #0 (operation="getAddress", code=UNSUPPORTED_OPERATION)"

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",

Invalid signature error from ethers when trying to verify a signature

I am working on a dapp that needs to verify users' signatures. When testing with Metamask, everything is okay. When trying to verify a signature from Ambire wal

`Property 'ethereum' does not exist on type 'Window & typeof globalThis'` error in React

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 { eth

My dapp doesn't detect when an user change their Metamask Account

I am in the process of building a dapp for a project. I have one last thing to adjust: detect when a user changes metamask account to reset the state but it doe

Set gas limit on contract method in ethers.js

Problem I am trying so use a method of a contract in the testnetwork (ropsten), but it fails due to this error: reason: 'cannot estimate gas; transaction may f

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