788 questions
2
votes
1
answer
62
views
Ethers.js can call fetchMarketItems() fine, but PHP (web3p/web3.php) fails to decode the tuple[] return — how do I read struct[] results?
I have an NFT marketplace contract running on a local Hardhat node. The function below returns an array of structs:
struct MarketItem {
uint256 tokenId;
address payable seller;
address ...
0
votes
1
answer
57
views
Contract deployed successfully on Hedera Testnet, but has no code. Script works for anvil
I have the following deploment script:
require('dotenv').config();
const { ethers } = require("ethers");
const fs = require("fs");
const path = require("path");
const ...
0
votes
1
answer
37
views
Correct way to obtain address from a BIP39 seed phrase using ethersjs v6
What is the correct way to get an address from a seed phrase, using ethersjs v6?
This is what I'm using:
import { HDNodeWallet } from 'ethers';
const hdWallet = HDNodeWallet.fromPhrase(seedPhrase, ...
1
vote
0
answers
47
views
Hardhat ethers.getContract("VRFCoordinatorV2Mock") returns undefined even though contract is compiled and deployed
I'm working on a Lottery Project (Raffle) in solidity using hardhat. For now it has two contracts as :
Raffle.sol
VRFCoordinatorV2Mock.sol
I created deployment scripts as :
00-deploy-raffle.js
01-...
0
votes
0
answers
33
views
Could not decode result data while connecting to wallet in local hardhat deployed token
async function connectWallet() {
if (window.ethereum) {
try {
const accounts = await window.ethereum.request({
method: "eth_requestAccounts",
});
...
1
vote
0
answers
69
views
ethersjs disconnects websocker after a while
I'm using ethers.js to handle functions and listen events on ethereum for both mainnet and sepolia. I'm also using Alchemy as RPC provider.
I have created a service:
import { Injectable } from "@...
0
votes
0
answers
46
views
NETWORK_ERROR. under next14 server side it cannot connect to local chain (eg, npx hardhat node), but the same file works fine if run standalone
general description of the problem,
OK if standalone run: ethers provider object can sucessfully attach with the hardhat local chain (ie, "npx hardhat node") at 127.0.0.1:8545, and do ...
0
votes
0
answers
40
views
Bad rate on pancakeswap
The rate of the transaction is always smaller than expected.
For example, I should be able to buy 7-8 tokens, but I only get 5-6. The same happens when I buy with WBNB — the rate is still not as good ...
7
votes
2
answers
160
views
Trying to send funds to a long zero (0x0000...0abcd) address isn't working
I'm trying to send hbar to a long zero address using ethers.js and it's not working.
I converted an accountId (0.0.5465603) to a solidity address (0x0000000000000000000000000000000000536603) but I can'...
2
votes
0
answers
27
views
How to write data into a hardhat test blockchain from a javascript front end using ether js
The contract is fully tested and has no issue, I'm having trouble writing data to the blockchain from the frontend, while the same function test successfully in the tests the don't work while coming ...
0
votes
1
answer
87
views
Solidity Testing. 1 wei issue. How to handle rounding differences when testing balance changes in ethers.js contracts?
I'm working on a smart contract test using ethers.js, and I'm facing an issue with rounding errors when comparing ether balances of accounts after executing transactions. Specifically, the problem ...
0
votes
0
answers
44
views
Deploying a proxy for the smart contract using hardhat ethers is not working
I am able to compile the smart contract successfully, which generates the ABI and bytecode for the contract as expected.
Below is my deployContract function that gets the ABI and bytecode for the ...
-3
votes
2
answers
195
views
how to convert the compressed public key to the uncompressed one using ethers js sdk?
When create a wallet using the ethers library, only the compressed publick key(33bytes) is generated. how could i get the uncompressed public key(65 bytes)?
0
votes
0
answers
38
views
How to withdraw from ETH Beacon Staking using privatekey with nodejs or python?
I want to make an automated ETH Staking withdrawal script to schedule it every day.
Is it possible to write an nodejs or python code that make it using privatekey?
Id tried to generate some code with ...
0
votes
1
answer
87
views
Failing to deploy smart contract through ganache gui
const ethers = require("ethers");
const fs = require("fs-extra");
async function main() {
try {
const provider = new ethers.JsonRpcProvider("http://127.0.0.1:7545")...