Questions tagged [ethers.js]

Ethers.js is a JavaScript framework to interact with EVM smart contracts.

More information on ethers.io.

801 questions
2
votes
1 answer

How to fix invalid hexlify value error in ethers.js

Error: invalid hexlify value (argument="value", value="PRIVATE_KEY", code=INVALID_ARGUMENT, version=bytes/5.7.0) I encountered an error while building an application to send a token from one wallet to another using Ethers.js and Node.js. I am using…
2
votes
5 answers

export 'utils' (imported as 'utils') was not found in 'ethers'

I trying to build a web app that can interact with blockchain, I'm using brownie as solidity framework and reactjs. I installed useDapp to connect with my wallet. but in the first simple usage i got this error: Compiled with problems: ERROR in…
Ahmed Laggoun
  • 85
  • 1
  • 11
2
votes
1 answer

WalletConnect with Ethersjs

is anyway to use walletconnect with etherejs ? the demos are nice but they are with wagmi i cant port all project from etherjs to wagmi i need this feature this button connect disconect and possibility to use only few networks/chainids import {…
user20922557
2
votes
2 answers

What does hardhat "deployed()" do?

I have the below code const SimpleStorageFactory = await ethers.getContractFactory( "SimpleStorage" ) const simpleStorage = await SimpleStorageFactory.deploy() await simpleStorage.deployed() await…
2
votes
0 answers

How to calculate maximum profitable trade amount when cross DEX arbitrage?

For example Token A costs 1.00$ on Uniswap and 1.05$ on Sushiswap. So I can buy Token A on Uniswap and sell on Sushiswap for profit. Let's suppose the next conditions: Uniswap reserve pool = 100 ETH / 100000 USDC. 1 ETH = 1000 USDC Sushiswap…
Serhii Zharkov
  • 496
  • 5
  • 22
2
votes
3 answers

getting error while using window.ethereum in Next Js with ether JS

Having Issues while using the window.ethereum with NextJs new version, The window.ethereum was working fine with the NextJs 12 but when I upgraded to NextJs 13 having this error. Is there any alternative for this? Code:- const provider = new…
2
votes
0 answers

How to filter erc721 mint transaction from pending pool?

what i want to do is filter ERC721 mint transactions from mem pool what i already known is : subscrib pending: txch := make(chan common.Hash, 1000) _, err = gcli.SubscribePendingTransactions(context.Background(), txch) or …
2
votes
0 answers

Swapping two non-ETH tokens (e. g. USDC for MATIC) programmatically with Sushiswap SDK (Uniswap V2) via JS

I'm trying to programmatically swap USDC for MATIC with a JS script. I found this SushiSwap SDK on GitHub (https://github.com/sushiswap/sdk) however it appears to be archived and instructions for swapping non-ETH tokens don't seem to be clear. Can…
codr
  • 889
  • 3
  • 13
  • 22
2
votes
2 answers

Get list of all ENS domains stored in a wallet address using Ethers.js

How can I get a list of all ENS names stored in a specific wallet using Ethers.js? for example; I want to get all the ENS names in this address; "0x8f635716982B836c4eB47e2F5c7B007Dde278F99" thanks.
2
votes
0 answers

Why do my Proxy-Contracts revert with CALL_EXCEPTION when loaded via hardhat and openzeppelin-upgrades

When I deploy a proxy contract and want to call a function on the proxy, I get a revert CALL_EXCEPTION. Code to reproduce Below the code how I deploy the Contract and load it as a fixture for tests. At this time, I can successfully query the…
delete
  • 18,144
  • 15
  • 48
  • 79
2
votes
0 answers

Unable to initialize OpenZeppelin Clone contract during Hardhat Test (Error: VM Exception)

I'm trying to create clones of my implementation contract (EIP-1167) using the OpenZeppelin Clones library, however I keep getting a VM Exception Error. This is the 'Initialize' function of my Implementation contract: contract Whoopy is…
ethereumboy
  • 101
  • 1
  • 6
2
votes
1 answer

Can I make Ethers Wallet Addresses pass RSK Testnet case checksum test?

On RSK public testnet, I create my RSK wallet with ethers like this: const wallet = await ethers.Wallet.createRandom() Then the address is: 0x68C06960f0Cd2bB0318673F157243Ad545AbbE2A When I send an amount to it, and explore the transaction on RSK…
Hamady C.
  • 1,205
  • 11
  • 13
2
votes
1 answer

How to create gasless-transactions/meta-transaction using ethers.js?

How can I implement a meta-transaction using ethers.js library or at least have another account paying a transaction, which was signed by different account? Consider a transaction to transfer 100 ERC20-tokens using a ERC20-contract from 0xAccountA…
delete
  • 18,144
  • 15
  • 48
  • 79
2
votes
1 answer

rsk private key encrypt - Error value parameter should be a number of string

I m trying to save my private key in a keystore v3 json format but when I try to encrypt it using the following methods: myNewAccount.encrypt('########') rsk.accounts.encrypt('the-private-key', '########') They both give the following…
Hamady C.
  • 1,205
  • 11
  • 13
2
votes
1 answer

How to map through data coming from smart contract

So I'm reading data from a smart contract and trying to map through it to display on a frontend but it keeps returning an error data is undefined I'll post my code below, I'm really looking forward to some help import React , { useState , useEffect…
mxnuchim
  • 35
  • 6