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
1 answer
19 views

Is there sdk to create new account in Polygon through web3

Is there any functions or API to create a new account in polygon, like hashgraph in hedera, is there any function or API to create a new account through code in the polygon? I really appreciate any ...
user avatar
  • 3
0 votes
0 answers
6 views

Obtaining ECDSA values to pass as arguments for a solidity function call

I am trying to call a function where a message must be signed and split to obtain the ECDSA values. I'm using splitSignature function from ethers to get the r,s,v values but the smart contract require ...
user avatar
0 votes
1 answer
56 views

Where to find Uniswap contract addresses on Goerli testnet

I am attempting to create a nodejs arbitrage bot. I can get my bot to fetch pairs from the mainnet but cannot fetch Uniswap pairs using the Goerli testnet. For example, on the mainnet to get the WETH/...
user avatar
  • 111
0 votes
0 answers
29 views

How does Axie infinity maintain variable information, such as breed count, to an axie that was already sold as an NFT?

From my understanding of the ethereum blockchain and NFTs in general, once an NFT is minted into the blockchain, its metadata freezes, making it immutable. An interesting question that entered my mind ...
user avatar
1 vote
1 answer
22 views

web3.eth - getBlock FetchError: request to https://eth-mainnet.g.alchemy.io/v2/api_key failed, reason: getaddrinfo ENOTFOUND eth-mainnet.g.alchemy.io

I'm trying to get Eth blocks by blockNum using Alchemy's apis. The docs mention two methods: getBlockByHash and getBlockByNum, but those methods don't exist on the web3.eth object. Here are the ...
user avatar
0 votes
1 answer
25 views

What is the complete beginner's road map for learning Web 3.0 Decentralized applications and writing smart contracts? [closed]

As a front end developer (using React.js), I want to understand blockchain so that I may create decentralised applications (dapps), NFT marketplaces, and solidity contracts. However, I'm not familiar ...
user avatar
  • 103
0 votes
0 answers
7 views

How can I verify the owner of a signature obtained using personal_sign?

I am validating users during login by requesting for a signature. How can I verify that the signature obtained belongs to the correct account owner? This is how I'm obtaining the signature : const ...
user avatar
  • 1
0 votes
0 answers
11 views

Get correct price value

I am attempting to get the current prices for some tokens from Uniswap and SushiSwap. I am using this function: async getBuyPrice() { const pathToBuy = await this.routerContract.methods....
user avatar
  • 111
0 votes
0 answers
11 views

i am trying to send a transaction but it throws an error. still i am not sending any transaction just signing it

eror on terminal if (!cond) throw new Error(msg) ^ Error: Expected private key to be an Uint8Array with length 32 and it's my code const Web3 = require('web3') const Tx = require('ethereumjs-tx')....
user avatar
  • 1
1 vote
1 answer
241 views

MetaMask - RPC Error: The requested account and/or method has not been authorized by the user

I'm following the tutorial on https://www.toptal.com/ethereum/one-click-login-flows-a-metamask-tutorial#how-the-login-flow-works. One of the sections shows an example of prompting the metamask for us ...
user avatar
0 votes
0 answers
16 views

Signed raw transaction displays incorrect sender address

I have a transaction which I sign and broadcast later. If i try to broadcast the signed TX the sender address is incorrect. If i recover the address from the signature it is of course the correct one ...
user avatar
0 votes
0 answers
25 views

Extracing v, r, s from signature and adding it to a transaction

I am trying to decode the v, r, s from a signature and add that to a transaction and broadcast at some point. When I convert the signature into v,r,s and build the raw tx the from: parameter does not ...
user avatar
0 votes
0 answers
17 views

I am following a documentation where the function will fetch BAYC (NFT) address but the function is not working as per the guidelines?

Link of the documentation https://market.link/nodes/NFTBank/integrations function getFloorPrice is expected to give the floor price after passing the input but it ain't returning anything The code in ...
user avatar
0 votes
0 answers
32 views

Let client-side sign transaction and server-side broadcast tx

I am trying to let an user sign a transaction and broadcast that at a later moment with the client-side. I am aware it is unsafe but it is for internal use only. I currently have this code and get the ...
user avatar
0 votes
0 answers
21 views

How to sign an ethereumjs-tx transaction client side

I have a function here that is supposed to sign a transaction and broadcast it after. With ethereumjs-tx you store the private key client-side injecting it into a buffer. Is it possible to let a ...
user avatar
0 votes
0 answers
48 views

Is it possible to send transaction in Polygon-mumbai using web3 and ethereumjs-tx?

const main = async () =>{ const abi = fs.readFileSync('erc20_abi.json', 'utf-8') const contract = new web3.eth.Contract(JSON.parse(abi), contractAddress); const transfer = contract....
user avatar
0 votes
0 answers
16 views

How to use AWS node as metamask node?

Sorry its really primitive and silly question but I'm very low on information about this area but from the things I've heard and I've seen I managed to create a node from "https://eu-west-2....
user avatar
0 votes
0 answers
32 views

MintItem function Throwing error in ERC721 Smart contract

I am trying to write a smart contract. which can store the uploaded files and later we can mint them. There are two files one is uploads.sol pragma solidity ^0.8.0; contract Upload { uint256 ...
user avatar
0 votes
2 answers
58 views

How to fetch the BAYC NFT Price from chailnlink or any other method?

I want to fetch BAYC NFT price using oracle. I have checked chainlink but didn't found any solutions.
user avatar
0 votes
1 answer
22 views

Calculate block/share difficulty

Introduction I am trying to obtain the share difficulty sent from my mining rig to the pool; I have captured the following stratum data: Work from pool sent to miner: {"id":0,"jsonrpc&...
user avatar
2 votes
2 answers
30 views

Claiming rewards in P2E game

I am currently working on P2E game. The game development is being underway in Unreal Engine 4. The users will play the game. And will achieve few tokens on behalf of their winnings. Let’s say I have a ...
user avatar
0 votes
1 answer
89 views

How to approve or give permission to access your tokens? Solidity /Metamask?

I'm currently creating a Dex which needs 1inch permission to access the users to tokens/funds. e.g The problem is permission doesn't show up but instead shows 'contract deployment': my current is ...
user avatar
0 votes
0 answers
14 views

Find current owner of Token on Etherscan using API

I am trying to find the current owner of the NFT TOKEN Id using etherscan API. The token has multiple transfers on various users. I want to know who is currently owning that NFT token id. I tried with ...
user avatar
  • 107
0 votes
0 answers
11 views

How can i listen emitted event faster on ETH

i try to listen any movement from a contract, it's working but i receive the result above 40sec after the block is minted. But on BNB chain i receive the information instantly but on ETH it's take so ...
user avatar
  • 1
0 votes
0 answers
5 views

How to get value on day of txn?

How to get value on day of transaction or closing price on date of transaction? [1]: https://i.stack.imgur.com/0LMZq.png
0 votes
0 answers
8 views

How to deploy Ethreum Smart Contract on Kava Testnet using kavatools?

suppose I have a contract and want to deploy it on Kava testnet pragma solidity ^0.8.0; contract MessageContract { string message = "Hello World"; function getMessage() public constant ...
user avatar
0 votes
0 answers
50 views

Metamask installed in browse chrome but when I check in console window.ethereum it respond undefined

I am trying to connect my contract through infuria in Rinkeby and connect Metamask to web3 as injection to give autherization. I successfully installed Metamask and deployed my contract, the problem ...
user avatar
  • 101
0 votes
1 answer
22 views

How do I send my custom erc20 token from ethreum to arbitrum?

I am trying to send my custom erc20 tokens from ethreum (testnet) to arbitrum(testnet) through arbitrum bridge. But not sure if I had to map my token first or arbitrum bridge does that itself? How ...
user avatar
0 votes
0 answers
18 views

Error not triggered on wrong RPC

I have a weird behavior when I call a function (mint) with a wrong RPC...First of all let me show you a function triggering properly an error in my code: const fetchBalance = (addressTemp) => { ...
user avatar
  • 21
0 votes
0 answers
11 views

Which chain do I choose for social tokens?

I am planning to launch social tokens. I was first planning to launch it from polygon, but now I feel if I launch it on polygon, I will not be able to use it on ethereum. So now I think ethereum is a ...
user avatar
0 votes
1 answer
82 views

Unable to validate signature using validateERC721OrderSignature(order, signature) function on the ERC721OrdersFeature.sol contract (0xv4)

We are building a NFT marketplace using the 0xv4 NFT contracts. We successfully completed integrations for onchain order processing, but are having a difficulty with offchain order processing. We ...
user avatar
0 votes
2 answers
138 views

Transfer ERC721 tokens in BULK to single address

I want to know what is the gas effective manner to code to transfer many (e.g 1000) ERC721 tokens to a single address. I have tried the way below but I want something more efficient. function ...
user avatar
  • 73
0 votes
0 answers
15 views

Getting issue while installing @ethereum-alarm-clock/cli

Ran Command : npm i -g @ethereum-alarm-clock/cli Issue received below : I am able to install other packages though, Is there something i need to do? while npm i -g @ethereum-alarm-clock/lib , I got
user avatar
0 votes
0 answers
28 views

Compare from Opensea API (assets > owner > address) with metamask address

Creates a test project. In my project, I would like to create an NFT verification. I would like to compare the API opensea if the owner has an NFT token on his wallet. The problem is that the account =...
user avatar
0 votes
0 answers
36 views

Recommendation for blockchain network selection

Is it a good idea to use fabric for one network, one organization (with multiple users), and storing transactions between those? or should I use a simpler blockchain network? I want the transaction to ...
user avatar
0 votes
1 answer
43 views

How can I use my polygon erc20 custom tokens on other chains?

I am planning to launch polygon erc20 coin. But I have come to learn recently that interchain smart contract interaction is not possible. If I want to use my polygon coins as a payment on ethereum ...
user avatar
0 votes
1 answer
24 views

How much data can I read from Smart contract, Is there a limit

We are aware that reading data is free from the Ethereum Blockchain. Is there a limit to the amount of data I can read? If someone runs a never-ending loop on the call, WIll block chain still give ...
user avatar
  • 107
0 votes
0 answers
29 views

How can we implement a use case where user need not sign transaction repetitively?

How can we implement a use case where user need not sign transaction repetitively? I want to create a marketplace but dont want to adopt Fiat payment mechanism? Also, I want to reserve my user's ...
user avatar
0 votes
0 answers
22 views

Web3js send method promise response when user refresh the page

I have a website that connect with a smart contract throught metamask provider. I'm using the send method and I'm managing every posible response of the promise, as on "confimration", on &...
user avatar
0 votes
1 answer
19 views

Can we change ERC721 mapping Access Modifier?

I am using openzeppelin ERC721 smart contract. That smart contract have a mapping's called : mapping(address => uint256) private _balances; mapping(uint256 => address) private _owners; Can we ...
user avatar
0 votes
0 answers
9 views

Problems sending tokens. The value you send should be less than your current balance

Im having this issue. I understand that: I have Contract A and Contract B If Alice has 100 tokens, and calls transfer on contract A, Alice's tokens are going to be transferred. If Alice has 100 tokens,...
user avatar
  • 25
3 votes
1 answer
82 views

Hardhat local transactions don't process

I'm new to hardhat. I am playing around with the local hardhat accounts, which are all funded for 10k ETH. All I want to do is send some ETH from 1 account to another, and check the second account's ...
user avatar
  • 31
0 votes
0 answers
51 views

Getting "Expected private key to be an Uint8Array with length 32" when running a transfer function on ropsten testnet through my terminal

i am trying to send a transaction but it throws an error. MY CODE: var Tx = require('ethereumjs-tx').Transaction const Web3 = require('web3') const web3 = new Web3('https://ropsten.infura.io/v3/...
user avatar
1 vote
2 answers
25 views

Is the key generated below valid and cryptographically secure?

For some reason, my React Native 0.68.0 app needs to generate private key for the Ethers wallet providing accessing to crypto.getRandomValues. The crypto.getRandomValues is polyfilled by react-native-...
user avatar
0 votes
1 answer
123 views

Is it possible to run hardhat node & hardhat deploy in Github Actions? | Github Action Stuck for hours

Currently using the code below for Github Actions to test local deployment. However, my github actions have been stuck for hours on Test deploy. Any ideas on how I can fix it? # This is a basic ...
user avatar
0 votes
1 answer
98 views

How to call a function of a smart contract if I only know the address of that contract in hardhat script?

I have a factory contract which creates a child contract upon calling a createChild function and emit an event that has the newly created child contract address. Now how to call any function of the ...
user avatar
0 votes
1 answer
371 views

use javascript merkle tree to generate hex proof for solidity merkletree validation

Here is my js code of generating hex proof for solidity verification const express = require('express') const { MerkleTree } = require('merkletreejs'); const { bufferToHex } = require('ethereumjs-util'...
user avatar
0 votes
0 answers
256 views

How to interact with a smart contract with ethers.js?

I need a general-purpose method to call functions from a smart contract using ethers.js. I've always used web3 and I'm trying to transition over; however, I cannot find any good examples of calling ...
user avatar
0 votes
1 answer
43 views

How to detect emit in another contract using hardhat?

I'm trying to replicate expectEvent.inTransaction() from @openzeppelin/test-helpers for hardhat. The scenario: token is transfering from owner to receiverContract. I want to check that ...
user avatar
  • 113
0 votes
1 answer
158 views

How to override transactionObject `{from: xxx }` in hardhat?

I'm trying to write a test to check if an approved address can transfer the owner's token. However, whenever I try to call token.transferFrom() with a transactionObject of {from: approved.address}, it ...
user avatar
  • 113

1
2 3 4 5
15