Questions tagged [ethereumjs]

For questions regarding the installation or use of EthereumJS, a Javascript library that implements a number of Ethereum utility functions.

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

Why use infura or alchemy?

I was being told that I needed to use infura/alchemy or use a etherium node in order to deploy, test, interact with contracts in the mainnet/kovan/rinkeby... networks. This I understand and makes ...
0
votes
0answers
5 views

How to get the address of a already deployed contract in hardhat's network?

I'm working with hardhat's local network, and I want to get the address of a deployed contract, I want to avoid deploying the contract again just to get the new address, I want to access to the ...
0
votes
1answer
37 views

Send ERC-20 tokens without eth or gas fee on Web3.js

I am developing an app using Web3.js where users send an amount of tokens to a new wallet. What I want is forward the tokens to another wallet but I am unable because the wallets where tokens are ...
2
votes
0answers
5 views

What is the role of a circuit in zero knowledge rollups

I am a student currently pursuing my bachelors degree in technology, for my final year project. I am trying to create a zk-rollup poc for nfts, I have came across different implementation of rollup ...
0
votes
1answer
11 views

Mint function with 2 or 3 parameters Reverted

I am building a mint DAPP on the fantom blockchain. However, when I call the mint function, it returns an error: (execution reverted: Invalid payment amount) My React app communicates well with the ...
0
votes
1answer
34 views

how to fetch private key of metamask account while transaction using web3.js

I have a problem, What I want is to user to come at my website, from where he/she can connect to its metamask wallet account, after connecting I want them to allow to do transaction from some specific ...
0
votes
1answer
19 views

Type bytes memory is not implicitly convertible to expected type bytes calldata

I'm using the openzeppelin library of TimelockController.sol. Specifically using the library's schedule function. function schedule( address target, uint256 value, bytes ...
0
votes
1answer
14 views

Can't call methods with ether

I have a simple contract: // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract Reentrancy { mapping(address => uint256) public balances; function depositFunds() external ...
0
votes
1answer
29 views

[SOLVED]: CANNOT find my pending transactions using: ether.js & [provider.on("pending") and provider.getTransaction(tx)]

I am using Quicknode and ether.js to monitor pending transactions using the following code: provider.on("pending", async (tx) => { provider.getTransaction(tx).then(function (transaction)...
0
votes
3answers
18 views

Correct default development blockchain port for truffle

How is the truffle port set when one runs truffle unbox react and then truffle develop ? The documentation states that the default port is 9545 (https://trufflesuite.com/docs/truffle/getting-started/...
1
vote
1answer
31 views

When using web3.js/Metamask on your website - how can you trust the data coming from your users?

So let's say your user sends a transaction, your script gets the receipt (getTransactionReceipt), checks if everything is fine and then does something. Can't people just rewrite your scripts in ...
0
votes
0answers
14 views

Quick ways to learn web3.js please?

could you please suggest some way's to learn about web3.js quickly? I have gone through https://web3js.readthedocs.io/en/v1.5.2/ it is really good, but it is so long and difficult to memorize. It's ...
0
votes
1answer
14 views

How to decode event data "0x0000000000000000000000000000000000000000000000000000000000000002"

I got "0x0000000000000000000000000000000000000000000000000000000000000002" which is "id" from event in the code below. And, I want to decode "...
0
votes
1answer
27 views

Calling a function unsing Web3 - External or Public

I have this function in the smart contract: function _mint(address account, uint256 amount) external onlyOwner { require(account != address(0), "ERC20: mint to the zero address"); ...
0
votes
1answer
19 views

Walletconnect integration not working on mobile

This is a weird one. I have successfully integrated walletconnect on my Dapp for the first time and it works just fine on my pc. When I try accessing it on my phone, it doesn't work. I am trying a ...
0
votes
0answers
5 views

when i try to get some faucet funds from rinkeby faucet it is giving me this errror : insuffisant gas price+value could you help me please [duplicate]

this is my adresse 0xb32914D408b65c154C449182924cC0e53926b02B if someone can help me to solve the problem
0
votes
0answers
11 views

pass signedTypeData signature into a function call

I'm trying to collect a signedTypeData signature so I can automate some transactions to chain to avoid going through the "verify with metamask" pop-up each time. I've collected my signature ...
0
votes
0answers
19 views

How Reflection token updates the tokens count of any user in wallet?

As the Reflect.sol only increasing the token value that the user have by manipulating the rTotal and _tTotal But, Q1) How is it updates the user tokens count in wallet this is confusing ?
0
votes
0answers
41 views

ETH/USDT LP With price0CumulativeLast and price1CumulativeLast to know price token with SmartContract?

Know the token price ETH/USDT-LP using price0CumulativeLast price1CumulativeLast Is it possible to calculate the price of the token? const price0CumulativeLast = await ETH/USDT.price0CumulativeLast(); ...
0
votes
1answer
57 views

SendSignedTransaction TIMEOUT

I'm trying to sign data offline and then send signed transaction via web3.js Here's my code snippet: const {sign} = require('@warren-bank/ethereumjs-tx-sign'); const {Loader} = require("loader-in-...
0
votes
1answer
20 views

Differences between .deploy() and deployed() methods

I am writing a js script that deploy my solidity contract. In the tuto, they use two methods .deploy() and .deployed() const main = async () => { const [owner, randomPerson] = await hre.ethers....
0
votes
1answer
69 views

Integrate wallet connect on my website

How do I integrate walletconnect on my website. Just link it is on pinksale.finance. Haven't found anything straight forward online. Thanks.
1
vote
1answer
20 views

etherjs provider without ApiKey?

I'm reading the documentation and I see that they say that it is recommended to have an ApiKey with one of the providers, eg: export const provider = new EtherscanProvider(); https://docs.ethers.io/...
0
votes
1answer
29 views

Status false Transaction mined but execution failed - Donatio contract

I'm trying to deploy my donating contract on FTM testnet in Remix. It compiles successfully, but when I run the donation function, I got this error: status: false Transaction mined but execution ...
1
vote
2answers
277 views

web3.js not working with React JS

I have installed web3.js npm install web3 my App.js import React , {Component} from "react"; import web3 from "web3"; import detectEthereumProvider from '@metamask/detect-provider'...
0
votes
0answers
58 views

Can I use a .json file to import arbitrary trait metadata to OpenSea when lazy minting?

I know how to manually add arbitrary traits to an NFT when lazy minting on OpenSea. I also know how to point to off-chain metadata, for instance with an IPFS hash, when deploying an ERC-721 contract (...
0
votes
1answer
22 views

Etherjs Transfer BNB Return 0 and doesnt end to Receiver Address

Hi im new to smart contract. Im trying to code a simple transfer using etherjs and nextjs. Basically below are my code import {ethers} from 'ethers'; const ContractAddr = '...
1
vote
2answers
46 views

how do I send a transaction for signature to metamax?

let byteCode = await web3.eth.getCode(contractAdress, (data) => { return data }) const txHash = await ethereum.request({ method: 'eth_sendTransaction', params: [ { ...
1
vote
1answer
125 views

Hardhat testing on testnet (Rinkeby)

I want to do some final tests on a smart contract that has been deployed on the Rinkeby testnet. I am trying to run the below script (saved in my hardhat test folder) with hardhat but get the ...
1
vote
0answers
58 views

How to create a custom nft collection from a web3 frontend

I am currently working on an NFT marketplace and although currently users can mint nfts and list them on the marketplace, All NFTs are minted under the defult NFT contract i.e // SPDX-License-...
0
votes
0answers
13 views

Get Ethereum Classic (ETC) transaction via web3 js

For ETH, I get a transaction like this: const trx = await this.web3.eth.getTransaction(transactionHash); and everything ok. But now I want to get transaction by hash for ETC, and it doesn't work. It ...
0
votes
0answers
56 views

incorrect signature verification ethers.utils.verifyMessage()

I'm developing a login system using ethers js and when checking the signature on the backend the result of the signature is not the expected wallet my function async auth({params, request, response, ...
0
votes
0answers
10 views

How can I use my wallet on metamask as static provider instead of window.ethereum [duplicate]

I want to store my provider to use it later as a service to swap tokens to every wallet I insert automatically, but the problem is I can't use my provider without window.ethereum so when I try to ...
1
vote
2answers
317 views

Metamask: wallet_addEthereumChain is not working when using polygon mainet but works with polygon mumbai

Im trying to programmatically switch the metamask network of the user. Using wallet_addEthereumChain It's working fine when requesting a network change for Polygon mumbai, however it doesn't work when ...
0
votes
0answers
15 views

Trouble calling smart contract methods in javascript

I am new to HTML and JavaScript and especially solidity. I am receiving this error - "Uncaught TypeError: VotingContract.returnVoterAddress is not a function". My js script is as follows: if ...
0
votes
0answers
25 views

Get a token price in date range on BSC network

I'm trying to find a token price in history, from a specific date to today date. And also I wanna get this information by token smart contract address. for example, get price history by token address: ...
0
votes
1answer
17 views

How to get different ethereum address for deposit functionality like binance

I want create deposit functionality like binance but i dont know how to create different ethereum address . If i use create2 then how much it will cost .
0
votes
1answer
25 views

Can I detect from tx metadata if a transaction made with a Metamask account were executed by a script?

I have a Metamask account what I use with web3.js/web3.py/or any web3 lib to buy and sell tokens. Is it possible to tell if the transaction was done from the Metamask Chrome plugin interface or was ...
0
votes
1answer
55 views

What is the difference betweeen getSigners() eth accounts and the eth account in .env?

I am currently learning the usage of the Hardhat deployment environment and I have some questions with regards to getSigners() I understand that getSigners() is an abstraction of an eth acc to be used ...
0
votes
0answers
27 views

Can I compile NodeJS server side Javascript to solidity?

I wish to write smart contracts for the Ethereum blockchain but would like to use server side NodeJS Javascript. Is there anyway to compile this for the EVM? I do realise that it may be expensive in ...
0
votes
1answer
62 views

How to send transaction to 1 specified block?

I'm interact with Ethereum using Web3js . How to send transaction to 1 specified block ? CASE : I want to send transaction to specified block is 1111 . I have tried listening Block Number but when ...
0
votes
1answer
23 views

Using balanceof function in erc20. i have few questions

Is it the number of tokens i have? or just the balance which i need to somehow convert into number of tokens if it is then how can i convert the balance into number of tokens? Thanks.
1
vote
0answers
94 views

Estimate transaction fee on BSC

When I make any transactions on BSC through TrustWallet I can see "estimate" of the gass fee I need to pay. On average for 5 gwei it's around 16 cents. Is it possible to calculate the gas ...
1
vote
1answer
42 views

How to programmatically calculate Max Priority Fee or TIP value EIP-1559?

As per Ethereum's EIP-1559 explanation It is possible that miners will mine empty blocks until such time as the base fee is very low and then proceed to mine half full blocks and revert to sorting ...
0
votes
0answers
152 views

Getting transaction history via Ethers.js

So I am new to blockchain development and I am trying to build a wallet just like the Metamask. I am struggling with displaying the recieved transactions. How dose one gets the recieved transaction ...
0
votes
0answers
125 views

Failed: [ethjs-query] while formatting outputs from RPC

I am working on a bet app which is someone else project. I am currently learning and researching it. I am using it locally with ganache truffle and it works fine on one browser a bet is created but ...
0
votes
0answers
58 views

Generating random number in smart contract using the random attribute of assets prices in liquidity pools

I'm aware of the disaster in relying on block.timestamp and block number when generating random numbers. But what do you think of XORing the prices of multiple ERC20 tokens using the getAmountOut() ...
0
votes
0answers
13 views

How do I write this self destruct function on BSC to work?

function destroySmartContract(address payable _to) public { require(msg.sender == owner, "You are not the owner"); selfdestruct(_to); } Something like this please?
0
votes
0answers
93 views

How to parse Ethereum transactions to extract all the details that we see on Etherscan?

Please consider this transaction: https://etherscan.io/tx/0x800391d2328e82e2cea40fd2cf2600f505baeefeb568e5bd5e75ebdeddcdd888 When I fetch this transaction using web3.eth.getTransaction, I get the ...
0
votes
0answers
12 views

Does deploy a smart contract create a new block in blockchain?

I am new to Ethereum and blockchain. I created a simple contact and use Remix to deploy it to a test network. The code: // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; ...

1
2 3 4 5
13