New answers tagged nodejs
0
votes
ethers SERVER_ERROR that cannot be catched with try/catch
It looks like RPC provider you are using is not stable. Try using another provider. If possible, infura or quiknode or another provider with ensured SLA
0
votes
Ethers.js recovers wrong address when signing its transactions with elliptic.js
The reason was that ec.sign expected the unsigned hash to be a BN type. Because the type of inputs with prefixed 0x is just too vague.
0
votes
I get error couldn't find module 'ethereumjs-wallet/hdkey'
The solution is that you import hdkey from the ethereumjs-wallet library. hdkey is being exported and it is not the default export.
const {hdkey} = require('ethereumjs-wallet');
const mnemonic = ...
1
vote
Accepted
Is there any way to send a raw signed transaction via ethers?
You can use the send function of the provider as per the docs: https://docs.ethers.org/v5/api/providers/jsonrpc-provider/#JsonRpcProvider-send.
0
votes
VM Exception while processing transaction: revert while buy token
The possible problem could be that you are checking the balance of the admin account, but transfering tokens from the sale contract.
// require that the contract has enough tokens
require(...
1
vote
How do I recover the address from message and signature generated with web3.personal.sign?
2023 answer.
import { recoverAddress, getBytes, hashMessage } from "ethers";
const recoverPublicKey = (message, signature) => {
const digest = getBytes(hashMessage(message));
...
0
votes
Accepted
What causes this error? NFT Minting via Piniata - fails transaction
Okay i found the issue, the issue is i had to ditch web3.js and use ethers.js instead
0
votes
CALL_EXCEPTION in estimateGas with local ganache
i was able to fix my problem by giving the gas prices and the gas limit
const overrides = {
gasLimit: 6721975, // Adjust the gas limit as needed
gasPrice: ethers.parseUnits("20000000000&...
1
vote
Accepted
Get multiple ETH transactions
So to use eth_getBlockReceipts with web3.js, you need to use the extend method that allows you to basically 'extend' the class and use any RPC method.
Note that it only works in web3.js V1. It was ...
0
votes
I am getting this error everytime i test my contract using hardhat
Fix Your Contract Function Name: In your Solidity contract, rename the function balanceof to transfer.
Run Your Test Correctly: In your test code, you're using the function balanceof in a way that it'...
0
votes
Get multiple ETH transactions
For free API's there's a limit of 1000 blocks . You can use alchemy's API if you think getblock isnt working. If your scope of work is only limited to finding out whether the to address belongs to you ...
Top 50 recent answers are included
Related Tags
nodejs × 777web3js × 409
solidity × 147
javascript × 124
go-ethereum × 100
truffle × 78
ethers.js × 67
blockchain × 42
ethereumjs × 41
contract-deployment × 36
contract-development × 29
contract-invocation × 28
infura × 28
transactions × 27
metamask × 27
hardhat × 27
ganache × 24
ether × 22
events × 22
tokens × 21
npm × 20
uniswap × 18
private-blockchain × 17
dapps × 16
react × 16