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
0answers
3 views

ProviderError: max code size exceeded - Hardhat

Iam trying to deploy a contract in ropsten testnet using hardhat but its throwing max code size exceeded error. i tried thisenter link description here bud didn't work added (...
0
votes
0answers
3 views

How to take input in remix for 2D array in solidity?

My Contract code contract SomeTokenVesting { mapping(address => uint256[6]) public vestingAmounts; constructor() { // some code } function addSomeBeneficiaries(address[] ...
0
votes
0answers
5 views

web3py The method eth_getRawTransactionByHash does not exist/is not available

I am trying to run a simple command w3.eth.get_raw_transaction - this somehow works on the Binance smart chain, but does not work on infura. tx_hash = "...
0
votes
0answers
10 views

MetaMask RPC Error: Already Known

I am trying to send a pair of transactions to a smart contract on Ropsten. I thought this might be a nonce issue on the second of the transactions where it wasn't being updated to a proper value but ...
1
vote
0answers
8 views

Signed Transaction on Ropsten undepriced

I am trying to send raw transaction data for a contract from a React frontend to a Node backend, sign it, then send it to the Ropsten network. However I am always getting the error "Error: ...
0
votes
1answer
12 views

How to convert decimals amount to eth?

From a subgraph I'm getting my total debt as: 1000148245, how can I convert this value to eth decimals?
0
votes
0answers
9 views

Why two Uni V3 pools have different bytecodes?

I am trying to assess if two smart contracts (address_1 and address_2) are both Uni V3 pools using web3. My idea was to request each contract's runtime bytecode as follows: sc_i_bytecode = w3.eth....
0
votes
0answers
8 views

UnhandledPromiseRejectionWarning: Error: invalid type (version=abi/5.0.7) When Decode Input Data Input in Binance Smart Chain (BSC)

I used web3js decode input data but dislay ERROR : UnhandledPromiseRejectionWarning: Error: invalid type (argument="type", value="_factory", code=INVALID_ARGUMENT, version=abi/5.0....
0
votes
1answer
21 views

In React.js, How can I get return data from smart contract method including event and emit?

I have smart contract server function and that function including emit and event. event TokenMinted( address indexed _recipient, uint256 indexed _tokenId ); function ...
0
votes
1answer
22 views

@ethereumjs/tx - "TypeError: Common is not a constructor"

I was trying to implement a method for signing an eip-1559 transaction using @ethereumjs/tx package. While following the steps mentioned in their documentation , I am encountering an error when trying ...
0
votes
0answers
33 views

How to write Test case for Internal functions in solidity which inherits the ERC721

**This is my Smart Contract code which has inherited the ERC721 and I want to write the test case for _setTokenURI ** contract ProductNFT is ERC721 { constructor () public ERC721(_tokenName,...
0
votes
0answers
16 views

Ethereum TX not sender - Returned error: invalid sender

I want to create a DApp by staking pools of Stake BNB Earn MyToken tokens. I've been looking for some references but I'm still confused, that's why I decided to ask. I have the following lines of code ...
0
votes
1answer
27 views

Handing over an address in solidity an saving it

pragma solidity 0.5.1; contract WissenschaftlicheArbeit { string titel; string autor; string pfad; string hashcode; bool isSignt = false; address adresseDesPruefers; ...
0
votes
0answers
32 views

How to indicate the gas price as a percentage of the balance?

Hello everyone, My goal is to get the balance of the wallet, then subtract 80% of the amount and convert this value to the gas price. The balance of the wallet is 100 ethers. *I decided to do this: We ...
0
votes
0answers
12 views

How can I input data from frontend to smart contract?

Hello I am new to smart contracts. I am trying to set data from a frontend into a smart contract and retrieve it after. When I am sending the data from the frontend into the smart contract and return ...
0
votes
1answer
17 views

How to get gas fee to send erc20 token at mass volume?

Pardon me for my poor english. What I am trying to achieve is: I am learning node JS developing a crypto currency exchanger as a homework project where user can deposit ERC-20 token and Ethereum. I am ...
1
vote
2answers
37 views

how can i fetch a data from file to function using solidity contract?

imagine that I have a list of voters data and I want to send a file to the function addVotersList to add all the voters by one click rather than sending the data one by one for each voter this is the ...
0
votes
1answer
30 views

while converting number 0.001 to BN.js instance, error: Value must be an integer, hex string, BN or BigNumber instance

I want to transfer 0.001 token and I cannot use web3.utils.toWei(0.001) as the smart contract has 12 decimal instead of 18 decimal. How can I correct it ? var decimals = 12; var amount = web3....
0
votes
0answers
9 views

How to extract function from dependent packages and save them locally?

I am writing a small tool in javascript to store something(as for privKey) into ehtereum contract storage area. For security, I want to strip off all dependent packages and extract the functional ...
1
vote
0answers
13 views

Better way to access ABI using Truffle in Production?

I would like to know what would be the best way to access ABI.json to interact with the contract using web3.js on the front end? I create a route (example: /abi.json) pointing to the ABI generated in ...
0
votes
1answer
23 views

Not able to use variable i for any operation inside for loop

I am new to solidity and stucked at very strange issue. I am not able to use variable i for any type of operation inside for loop. for (uint256 i; i < data.numPoints; i++) { //uint256 xx = ...
0
votes
0answers
17 views

How to get logs of all `transfer` methods in blocks?

I want to get logs of all transfer methods in the block. I am using web3.js or ether.js. I have to set fromBlock and toBlock. This is my sample code. But I can't set fromBlock and toBlock. Now, I get ...
0
votes
1answer
19 views

How to decode log's topics?

I got logs using the following code. web3.eth.subscribe('logs', { address: getLogsAddress, fromBlock: '0x' + fromBlock, toBlock: 'latest', topics: [topics] }, function(error, ...
0
votes
1answer
92 views

Unhandled Rejection (TypeError): param.map is not a function

Using Web3to execute transactions, and getting the following error: Unhandled Rejection (TypeError): param.map is not a function Uncaught (in promise) TypeError: param.map is not a function at ...
0
votes
2answers
24 views

When to break a single Solidity Contract into Multiple Solidity Contract?

What are the advantages and dis-advantages of using single and multiple solidity contract?
0
votes
0answers
21 views

Handle Revert and require message

I know this has been 'answered' in a few places. but I still can't get it to work. I'm trying to work out how to get the custom require message from my contract.I set handleRevert = true;But I can't ...
0
votes
0answers
11 views

'web3' is not defined no-undef even after importing

I imported web3 but why this annoying error is occurring please help me... i imported like this import Web3 from 'web3' and the error is occurring here this.web3Provider = web3.currentProvider
1
vote
1answer
199 views

What is the logics behind Q64.96 number?

Checking the math behind uniswap v3 and I constantly seeing the term: Q64.96 in sqrtRatioX96 I am just wondering if this is a naming convention in smart contract world to describe the format of the ...
0
votes
1answer
12 views

Best approach to replicate a complex piece of solidity code in Javascript/Typescript

I am working on replicating a piece of complex Solidity and assembly code in Typescript and I wonder what would be the best way to approach this. Is it for example possible to execute a piece of ...
1
vote
0answers
15 views

How to decode estimateGas Error

i'm having a problem with estimateGas function. var method = contract.methods.doSomething(); var estimateGas = await method.estimateGas({ from: address, to: toAddress, }).then(...
0
votes
1answer
18 views

Can you filter an indexed event parameters?

Can you filter an indexed event parameters? Does indexing make filtering more efficient or does indexing make filtering possible?
0
votes
1answer
16 views

Can I get ETH in redistribution wallet

I am trying to create a token on Ethereum, basic one like usual redistribution tokens that sends a percentage to my wallet on sells. I am receiving tokens in the wallet, but I want to use that wallet ...
0
votes
0answers
8 views

How can I ever connect my handlebars frontend with solidity?

So I created a dapp which is for online voting and I have to connect that with handlebars frontend. any idea how can I do that?
1
vote
2answers
53 views

Who pays gas fee for ERC-20 token transactions in exchanger?

i am developing an exchanger as a hobby project in next js. I am just starting to learn about blockchain. I am generating new deposit ethereum addresses for every user. Now my main confusion is, when ...
0
votes
0answers
17 views

Uncaught Error: Cannot find module 'web3-eth'

const ethereumButton = document.querySelector('.enableEthereumButton'); const showAccount = document.querySelector('.showAccount'); ethereumButton.addEventListener('click', () => { getAccount(); })...
0
votes
1answer
161 views

Quickswap router function error when liquidity is added on WMATIC pair

i've been trying the functions from the router using the web3.py library. However am getting into troubles when calling the function with a WMATIC/Token liquidity pair and using USDC as currency to ...
1
vote
1answer
46 views

to which extent smart contracts are upgradeable

I have a smart contract deployed on ethereum network, I might have to change it according to future requirement changes, as they are immutable, then to which extent I would be able make changes in my ...
1
vote
0answers
22 views

Important Question regarding Github repository. Need kind Help!

I am facing some errors during the installation of dependencies. whenever I run npm install the dependencies start downloading however after a few seconds it gives the following error shown in ...
0
votes
0answers
8 views

Ethereum and DBMS

If Ethereum is a database, does that make smart contracts or decentralized applications a DBMS? If not, what kind of DBMS is related to Ethereum? Or any other blockchain?
0
votes
0answers
53 views

tx fee (5274661132.35 ether) exceeds the configured cap (1.00 ether) Web3 JS

New to web3 JS. using Binance Smart Chain (mainnet) :( I am getting this error: tx fee (5274661132.35 ether) exceeds the configured cap (1.00 ether) Below are my parameters (done on php for some ...
0
votes
0answers
94 views

MetaMask - RPC Error: Error: [ethjs-query] while formatting outputs from RPC

I am very new to Ethereum smart contract solidity programming. Currently, I have been facing this issue when I try to pass a variable from my Node.js servlet to the smart contract I deployed using ...
0
votes
1answer
27 views

How in Solidity can you get initial value from the sum of ratios to it?

In Solidity division of uint256 rounds down the value. Let's say I want to issue some token amount based on duration like this: uint256 MAX_TIME = 365 days; uint256 Duration1 = 223 days; uint256 ...
0
votes
0answers
12 views

Is it possible to trigger several times "metamask" connection to different wallets?

I'm trying to trigger metamask popup to connect new wallets even if I already connected one by clicking a "Add another wallet" button. I have days trying to replicate the behavior you see in ...
0
votes
2answers
28 views

Manually deploying a transaction

For educational purposes, I would like to manually create and publish a transaction. I want to see what's needed for the transaction and how everything is done. With my current code, using Etherscan's ...
0
votes
1answer
677 views

i'm getting this erreur with my metamask, RPC Error: Internal JSON-RPC error

I am getting this error when i trying to use metamask on my gancache local for a simple transaction Metamask is connected to my ganache this is the erreur and this is how i called my methode packItem:...
0
votes
2answers
92 views

how to pass uint32[], uint8[] parameter to smart contract in web3.js

I'm doing estimateGas. here's my code. var sdate = new Date('2021-07-01 00:00:00'); var edate = new Date('2021-07-31 00:00:00'); var arrDate = []; arrDate.push(sdate/1000); arrDate.push(edate/1000); ...
1
vote
1answer
422 views

Web3js Error: transaction type not supported - How to know supported transaction type?

I'm trying to send a test transaction but am getting a "transaction type not supported" error, and I tried every transaction type supported in the @ethereumjs/tx docs. const Web3 = require('...
0
votes
1answer
105 views

"Error: Provider not set or invalid" When accessing contract methods

I have write a contract and deployed it through remix-ethereum IDE. That process goes alright. While accessing functions of contract through web3 in javascript I get following error Error: Provider ...
0
votes
1answer
20 views

Why contract.on(filter,...) returns [object Object] when listening to events?

In javascript: const info_contract = new ethers.Contract(address, abi, signer); const info = info_contract.connect(signer); let instructorFilter = info.filters.Instructor(null, null); info....
1
vote
0answers
10 views

startnode.cmd file not recognized

When I opened my folder mygethnode in VSC. There are only two folders named geth and keystore and 4 json files. .puppeth folder and startnode.cmd file is not there. How to edit the parameters without ...

1
2 3 4 5
11