Questions tagged [etherjs]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
14 views

Help! Getting Error ' Cannot read properties of undefined (reading 'then')' How do I make a Contract Transaction using EtherJS v6

I tried making request to the contract using 'contract.otherFunction()' and they are working fine but just the 'placeBid' function where I have to use add value is giving the error 'Getting Error ' ...
9192_AltonDsilva's user avatar
0 votes
1 answer
28 views

TypeError: Cannot read properties of undefined (reading 'match')

I'm new to Solidity and ether js. I'm stuck with error below in VSCode. Can anybody help explain what this error means and advise how to fix this? Thank you so much! ERROR BELOW: (node:5884) ...
David Blake's user avatar
1 vote
1 answer
21 views

Please somebody help me with this error in getting transactionReceipt : "TypeError: contract.deploymentTransaction.wait is not a function"

const ethers = require("ethers"); const fs = require("fs-extra"); async function main() { // http://127.0.0.1:7545 let provider = new ethers.JsonRpcProvider("http://127.0....
imbot's user avatar
  • 11
0 votes
1 answer
98 views

simulate a transaction considering another pending transaction

I have the following problem and have hard time to simulate it to get the answer. Let say I have a 5 WETH tokens. I sent transaction X with nonce 1 to transfer 5 tokens from Account A to Account B. ...
Majd TL's user avatar
  • 3,167
0 votes
0 answers
33 views

Seeking Help with React Typescript App and Ether.js - Trouble with Tuple Arguments

I'm currently working on a React Typescript app that involves interacting with contracts on the blockchain using Ether.js. While making progress, I've encountered a hurdle that has me scratching my ...
bero's user avatar
  • 1
0 votes
1 answer
62 views

Error: network does not support ENS (operation=“ENS”, network=“maticmum”, code=UNSUPPORTED_OPERATION, version=providers/5.5.3 Network doesnot support

Hello I wrote a smart contract for crowd funding Actually I have two contracts One is create a campaign for donate funds and second is created campigns for crowd-funding and store all the campaigns ...
Yasir Saeed's user avatar
0 votes
1 answer
112 views

Is it possibleimpersonate an account using only ethers.js without using Hardhat

Is it possible to impersonate an account using ether js only? I don't want to use Hardhat. Though I have forked mainnet using foundry. Now wants to transfer eth of let's say vitalik to my own account ...
DEEPAK Kumar's user avatar
0 votes
0 answers
109 views

Error: cannot override "to" (operation="overrides", overrides=["to"], code=UNSUPPORTED_OPERATION, version=contracts/5.6.2)

I'm facing this error while I'm trying to mint with sending transaction const tx = { from: accounts[0], to: ContractAddress, value:...
Bugblock's user avatar
1 vote
0 answers
72 views

Unable to run concurrent contract executions on polygon mainnet (Alchemy)

I'm currently encountering a peculiar issue on the Polygon Mainnet, which doesn't seem to occur on the Testnet. When running two or more parallel node processes which have two different wallets with ...
Rakesh Bhatt's user avatar
1 vote
0 answers
87 views

Sushi swap Flash swap [closed]

I'm trying to arbitrage between sushi and uniswap whats the smart contract to arbitrage from sushi swap to uniswap , [fl ash loan from sushi]
RichMond's user avatar
2 votes
1 answer
615 views

Can someone explain me providers and the different types of it?

I can make providers using ether-hardhat, alchemy, and metamask. What is the difference between these?
amit's user avatar
  • 370
1 vote
1 answer
187 views

Not able to send transaction using alchemy sdk

Hey i have to build a ERC20 contract and using alchemy sdk to send transactions onchain For eg mint or burn tokens. But i am not able to send a transaction as its showing an error of cannot estimate ...
Yakshesh Gupta's user avatar
0 votes
1 answer
41 views

reactjs get contract call fees

Chain used: Poylgon/mainnet or mumbai I am trying to get gas fees for a contract call. I should be able to let user chose if : Medium or High Same as metamask does it: but this should be done on user ...
heustfd gehsgd's user avatar
0 votes
1 answer
309 views

Signatures created in metamask with ledger is being rejected by ECDSA.recover

Some context. The frontend right now is using wagmi under the hood, we are using the signMessageAsync method to generate a signature. Code is below const { signMessageAsync } = useSignMessage() ...
Franrey Saycon's user avatar
2 votes
1 answer
2k views

Uniswap Universal Router - Decoding the Execute function parameters

I used the method described in this thread (Decode Uniswap Universal Router transaction in ethers.js) and decoded most of the data of a transaction at this link: https://arbiscan.io/tx/...
python_rok's user avatar
1 vote
2 answers
538 views

Difference between provider.sendTransaction vs signer.sendTransaction?

I am finding it difficult to see the difference between these two, what are their respective use cases?
amit's user avatar
  • 370
0 votes
1 answer
19 views

Why am I facing error here? Related to signing transactions

Why this error occuring?? Can someone direct me to some good resources where I can see what units to provide in the parameters?
amit's user avatar
  • 370
0 votes
1 answer
178 views

InvalidInputError: Received invalid block tag 642829559307850963015472508762062935916233390536. Latest block number is 1

After compiling the below dead-simple contract // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; contract SendWei { function sendWei(address payable recipient, uint256 amount) public ...
Sprint's user avatar
  • 3
0 votes
0 answers
165 views

why am i getting this big number error. I have tried everything but cannot figure it out

I am trying to run the scripts for uniswap V3. I am able to mint the positions and check the position but I cannot increase or decrease the liquidity by calling these functions. I get the following ...
Nunce.ether's user avatar
1 vote
0 answers
65 views

Getting wrong signature while using etherjs in react native

I'm trying to get the signature using etherjs in a react native project which should be compatible with ECDSA.sol, When i try to get the signature with metamask it returns totally fine. but when i try ...
Hamza Yasin's user avatar
0 votes
0 answers
154 views

ether.js ethers.utils.defaultAbiCoder.decode [ [Getter] ] result

ethers.utils.defaultAbiCoder.decode(['address'],'...
user10834730's user avatar
1 vote
1 answer
251 views

How to read a transaction in human readable format using web3?

I am using Alchemy API as my web3 provider and got a transaction data like this below: { blockHash: null, blockNumber: null, from: '0xa12e1462d0ced572f396f58b6e2d03894cd7c8a4', gas: '0x440f0', ...
Neo Liu's user avatar
  • 117
1 vote
0 answers
221 views

nextjs, etherjs, invalid address or ENS name

I'm using Nextjs. on sample.jsx console.log(address)// 0xd56A6DB7d844722627473C07f840c2604E622161 console.log(typeof(address)) // string const ethers = require('ethers') let url = "https:/...
user6894661's user avatar
1 vote
0 answers
454 views

getCreate2Address (create2) UNABLE to get correct contract address :(

UPDATE: I think the real question is what to use as Init code? The contract has no constructor. Can someone help on this? Basically i am using openzeppelin Clones.sol contract to determine the ...
smenir443's user avatar
  • 125
0 votes
1 answer
84 views

I am getting this error when I deploy my contract in ganache using the command node deploy.js

I am getting this error when I deploy my contract in ganache using the command node deploy.js
HARI SUDARSAN's user avatar
0 votes
0 answers
27 views

Unable to compile the FullMath.sol of Uniswap v3 with Hardhat [duplicate]

I've been trying to compile the FullMath.sol in a project using Hardhat. However I have this error and I didn't seem to find any solution except for an issue created for that very same problem. The ...
VDS-Atomic's user avatar
0 votes
0 answers
44 views

"internalType": "enum how do abidecode

2f6769746875622e636f6d2f436f696e73756c742f736f6c69646974792f626c6f622f6d61696e2f5473756b75796f6d69447261676f6e41756469742e706466222c2263223a22222c2264223a22222c2265223a22227d00000000000000000000000000 ...
user10834730's user avatar
0 votes
2 answers
414 views

Deployed an ERC20 with Hardhat, trying to mint token but getting "TypeError: _mint is not a function"

A bit of messing around with Hardhat and ERC20 deployments. I've deployed a created and tried to mint tokens for an account using this small snippet of code: const ERC20 = await hre.ethers....
VDS-Atomic's user avatar
1 vote
1 answer
615 views

How to get ABI from the source code programmatically?

Is it possible to get an ABI from the source code without using solc compiler? Like I can get source code of verified contracts through etherscan API and I want to convert it into ABI. Are there any ...
Ad-h0c's user avatar
  • 928
1 vote
1 answer
283 views

Contract Factory Deploy Function Variables

I noticed you can actually put 3 arg into the deploy functions .deploy(0,0,0) min 3 , what is the purpose of the 3 variables. I. can't seem to find it on the documentation Documentation Reference : ...
CodeGuru's user avatar
  • 111
0 votes
2 answers
325 views

I am getting this error everytime i test my contract using hardhat

This is the error i am getting while testing my contract with hardhat pls help me to get this PS E:\vs code files> npx hardhat test npm WARN config global `--global`, `--local` are deprecated. Use `...
Abhishek Yadav's user avatar
0 votes
2 answers
63 views

Mismatch in WETH shown in Metamask wallet and shown by code

tokenContractAddress is 0xc778417E063141139Fce010982780140Aa0cD5Ab on execution, returns but balance of WETH in my wallet is 2 WETH as i can see. How is it possible?
Rohit Mittal's user avatar
0 votes
1 answer
84 views

Can I make a transaction using Etherjs without signer?

Is it possible in EtherJS to execute a transaction/s without using signer ? Or If we could setup the signer one time and use that signer indefinitely.
Syed Murtaza Ali Shah's user avatar
2 votes
2 answers
824 views

How do node providers (e.g. Infura, Alchemy) determine gas pricing on contract writes?

When writing to a smart contract, we can specify the priority and fee per gas. await contract.connect(owner).foo({ maxFeePerGas: "<YOUR FEE>" maxPriorityFeePerGas: "<YOUR ...
Reginal's user avatar
  • 65
0 votes
1 answer
292 views

How to Call a payable function I am getting error={"code":-32603,"message":"Internal JSON-RPC error.","data":{"code":3,"message":"execution reverted"}

I am trying to call buy function which is a payable function using metamask signer method. I am getting error for sending incorrect ether value. Here I have set the price as 1 which is 0x01 in hex ...
crypto S.'s user avatar
  • 345
2 votes
0 answers
286 views

How to listen for multiple smart contract events?

Using Web3.py I understand that I can create a new smart contract event filter with: Contract.events.your_event_name.createFilter(fromBlock=block, toBlock=block, argument_filters={'arg1': 'value'}, ...
d3f2's user avatar
  • 31
4 votes
2 answers
3k views

How to mock smart contract function for testing (in hardhat)

In my Test I want to mock an external function that I call inside my smart contract to test both conditions without writing and deploying an extra fake smart contract. My Contract //SPDX-License-...
Majd TL's user avatar
  • 3,167