Category "ethers.js"

Get ETH Balance with Ethersjs

I'm trying to get the balance of my wallet address to render on my frontend. Here's what I have so far. const [balance, setBalance] = useState(""); const hand

How to force the transfer of an NFT using Web3.js or Ethers.js

I am trying to build an application, and part of it involves transferring an NFT from my account to the user's. Previously, I was using Moralis to accomplish th

Web3: Cannot read properties of null after new ethers.Contract

I am trying to use a smart contract just after I instantiate it. However, I get an error: Uncaught (in promise) TypeError: Cannot read properties of null (read

How to run an hardhat script on NodeJs so that you can fork multiple evm chains on different ports?

I want to be able to fork more chains (ethereum, bsc, etc.) than just one on my system. Hardhat doc shows, how to fork 1 chain npx hardhat node --fork https://

ethers.js Contract object gets error: Uncaught TypeError: Cannot read properties of undefined (reading 'map')

I hope someone can enlighten me. I have a website with a button which should create a new Contract object of my token contract via the ethers.js library. I succ

WalletConnectProvider not working with custom RPC

I want to connect custom RPC with WalletConnectProvider. But I keep getting an error of Uncaught Error: PollingBlockTracker - encountered and error. Here below

Getting an error when trying to execute the deploy script

I'm getting a Transaction reverted without a reason string when I try to execute the deploy script. Smart Contract: //SPDX-License-Identifier: MIT pragma solid

Error: missing revert data in call exception while testing with Hardhat

I want to test get my function TokenUri using hardhat. Here it is: function tokenURI(uint256 tokenId) public view virtual override returns (string memory){

Error connecting to localhost after npm hardhat run

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-3j

No safeTransferFrom function in ethers.js contract instance?

I created a contract instance in hardhat console like so: const contract_fac = await ethers.getContractFactory("ContractName"); const contract = await contract_

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