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

input field is not getting displayed by using ContractForm

<DrizzleProvider options={drizzleOptions}> <LoadingContainer> <div> <h1>Welcome Doctor</h1> ...
0
votes
2answers
13 views

Recovering of typed signature fails because it's too long

I have a typed signature generated by EIP712 V3. It is 132 characters long. I'm trying to recover it using recoverTypedSignature from eth-sig-util. This fails saying: index.js:1 Error: Invalid ...
0
votes
0answers
30 views

Could not find declaration module for file 'solc'

I was trying with a simple contract,when I do "node compile.js" in my windows cmd it throws an error.I was using vscode it showing error in const solc = require('solc'),I installed everything ...
0
votes
0answers
14 views

Why does Infura Ropsten websocket filtering event timeout?

When listening events via Infura Ropsten websocket, web3.py implementation timeout while web3.js succeeds. The demo can be cloned from -- https://github.com/jerryji/ropsten_wss_timeout_demo After ...
2
votes
1answer
15 views

What does it mean to serialize a transaction?

In tx library there is a function: serialize() that "serializes" your transaction object. You can then convert that serialization into hexa decimal string, and use it to send the transaction with the ...
0
votes
0answers
12 views

Extract function names alongwith their parameter name and types from abi JSON file

My task is to get function names, its parameters and type of parameters from provided .json file. Then call each extracted function with extracted parameters. The code from this Get all function names ...
0
votes
1answer
21 views

Could not call contract function

I want to access the balance of contract(i.e. 0x552F3AfaA0394632f4aEfa9E923fA3e2bbDAF5FE) and its totalSupply(state variable). I could access the balancec of this contract , but why I could not call ...
1
vote
0answers
22 views

pass struct from web3 python interface to solidity

I have created a smart contract with some solidity functions which take structs, enums and mappings(all defined in my contract) as arguments. I intend to call these functions from my web3 python ...
0
votes
2answers
30 views

Calling smart contract functions and submitting transacions in BACK-END in high level

I have read some references to create ethereum transactions by a BACK-END server, all in low level, for example, requiring that I control the nonce by myself. Are there safe ways to avoid this control ...
0
votes
3answers
32 views

Could not assign contract state variable value to javascript variable

I want to retrieve and assign the value of my contract state variable to my javascript variable.I am doing as per guidlines provided on this community, but failed to assigned. my javascript code is ...
0
votes
0answers
22 views

SendSignedTransaction is not sending tokens

I tried to use sendSignedTransaction function, it signed and sent the transaction successfully(i think), but it's not transferring tokens as it ought to. It's basically not doing the intended task 😔 ...
0
votes
2answers
13 views

How to edit transaction data of an ethereum transaction? Or in other words, create a manual transaction, for contracts with no front end?

This strikes me as a very stupid question, but I have googled and cannot find an easy answer. I have identified a contract that I want to interact with- I know the function selector and the variables ...
0
votes
1answer
29 views

Contract deploy error with Cannot create property 'from' on string

I am getting this error, when I deploy contract by using web3. TypeError: Cannot create property 'from' on string '...
0
votes
1answer
28 views

How can a smart contract payable based function returns value against any purchase

I am trying to get a return value from the payable function, the idea is a user must pay the fees and in return, he will get his special code. My JS test code is as follow it('get special code ...
0
votes
0answers
54 views

What is the networkid and chain id of truffle cli?

I am using truffle console to deploy contracts and using Nodejs/web3js to interract with it. I wanted to use ethereumjs-tx for signing transaction, here is the reference link. I am not sure ,how can ...
0
votes
1answer
29 views

rpc error with payload and exception thrown in contract code

This is the problem I get when trying to run my contract! And then when I go ahead and run it, this pops up This is my js code: import React, { Component } from 'react'; import Web3 from 'web3'; ...
0
votes
2answers
47 views

Exchange ERC20 token with other ERC20 token

I have 2 ERC20 tokens. The contract are designed as standard ERC20. Here are the 2 tokens to take as an example - AUDC --> Contract Address: (0xContractAUDC) Wallet Address: (...
1
vote
1answer
14 views

Geth and JavaScript

I want to deploy a private blockchain using Geth. I am considering using JavaScript to build the backend as I did before (NodeJS) but what about the smart contract? Since it is private is there a way ...
0
votes
1answer
30 views

How to parse ecrecover parameters?

I am looking into getting the public key from ANY ethereum address (not owned by me) that has sent a transaction at least once. It seems that the most viable solution here would be to use ethereumjs-...
1
vote
2answers
37 views

I Call SmartContract Token ERC20, Why Show Hashing Output ? (Web3 + Metamask + Javascript)

I do not know why with this, even though in the previous version (web3 + Metamask) can issue real data. But now used as hashing (output). I took the example in the code and output below (to get the ...
0
votes
3answers
84 views

How to build a decentralised Voting Website without using any 3rd party extensions like Metamask, or IDEs like Remix? [closed]

I've gone through various Blockchain Tutorials but everywhere it's one or the other same thing. Download truffle/ganache, from 10 free testrpc account, use one, use metamask, Remix IDE etc, and Voila!...
0
votes
0answers
40 views

Transactions go to an older contract address rather than the present deployed one

Though I have deployed a new contract but the transactions go to a previously deployed contract in my application. I'm attaching the screenshot of my Remix-ide code and the code for the front end ...
0
votes
1answer
276 views

problem connecting web3 v 1.2.1 with metamask : 'currentProvider' of undefined

I am using Web3 v1.2.1 with nodejs v10 and following this link. I am having issue connecting with metamask,below is my code snippet: const Web3 = require('web3') const window = require('window'); ...
0
votes
1answer
36 views

Code:const web3 = new Web3(window.web3.currentProvider) Error: window.web3 is undefined

I am going to connect my contract with the website.However,there was something wrong with the web3? I'm not sure. import Web3 from "web3"; const web3 = new Web3(window.web3.currentProvider); const ...
2
votes
1answer
109 views

Which version of web3 shall i be using now?

I found the documentation of version 1.0.0 which was released on the 6th of August here. I was told that v1 is not stable and very different than earlier versions. But when i check the available ...
0
votes
3answers
65 views

transferFrom function not working in ICO Smart contract

I am facing issues with the transferFrom function of smart contract address 0x6560a9b6436e129cf835ab9da96201207facd4f8: I copied the smart contract code from etherscan.io and deployed on ropsten ...
1
vote
1answer
100 views

How do I use web3js 1.0.0 in geth 1.9.0? I want to import an account whose address, private key and passphrase I have in my geth node [duplicate]

I am at Geth/v1.9.0-stable-52f24617/linux-amd64/go1.11.5 web3JS version is giving : > web3.version { api: "0.20.1", ethereum: "0x2712", network: "4", node: "Geth/v1.9.0-stable-52f24617/...
0
votes
0answers
25 views

Error: Keystore: Must include seedPhrase in createVault inputs. How to fix?

i'm studying blockchain development, and i'm trying to create wallet with seed words using eth-lightwallet and vuejs. But i receive this error: Keystore: Must include seedPhrase in createVault inputs, ...
2
votes
0answers
23 views

What is the difference between signing a document, signing a transaction and signing a message? (very basic)

As per my limited knowledge in Ethereum, user can sign the object(doc, Tx, msg) for the security purpose and with the public key other user can get that object. But not understand the difference ...
0
votes
0answers
41 views

How do I perform a fully anonymous transaction using Stealth addresses in Aztec protocol?

I want to know how to make use of Aztec's stealth address protocol.
0
votes
0answers
18 views

Can I Create Node.js API for each function in Smart Contract but sign a Transaction from frontend via Metamask.?

I am trying to develop a Dapp with nodejs backend but I cannot get accounts from Metamask which resides on my frontend. I tried to create an endpoint for each function in Smart Contract. And it seems ...
2
votes
1answer
31 views

How to know in advance the gas used by a transaction?

I want to send an ERC20 token (Ropsten network). So I execute a function 'transfer' on a contract. When The transaction is sent, I can get the gas used in the receipt. Few months ago this amount was ...
0
votes
0answers
17 views

Is there a way to broadcast/send transaction using web3js using token that is not ethereum?

My question is: I am trying to send a transaction using a cryptocurrency very similar to ethereum, in fact their code is almost copy pasted from ethereumjs: https://github.com/CSEPlatform/cse-tx/blob/...
0
votes
1answer
171 views

'ALERT: Trying to call a function on a non-contract address' Why Do I Keeping This Error?

This is the error from metamask directly: This is the error I get once after I submit the information to IPFS: My Smart Contract: pragma solidity 0.5.3; //Imports for safe math operations import "...
0
votes
1answer
48 views

Why txHash in sendSignedTransaction giving Undefined value on sending on rinkeby testnet

let Tx= require('ethereumjs-tx').Transaction; const Web3= require('web3'); const url='https://rinkeby.infura.io/v3/d4dbc79ea192404fb42689cc55ce2fc0'; const web3 =new Web3(url); const account1= '...
0
votes
0answers
34 views

Error using drizzle and react

My contract Storage.sol - pragma solidity ^0.5.0; contract Storage { string public data; function getData() view external returns(string memory) { return data; } function setData(...
0
votes
0answers
14 views

Error send token

let minABI = [ // transfer { "constant": false, "inputs": [ { "name": "_to", "type": "address" ...
0
votes
0answers
18 views

How to save contract address to database with web3js and mongoose when I deploying a contract?

I wanted to get my contract address after it deployed, and then save it into my mongoDB. But instead of that, my contract address is deployed after it. So my mongoDB won't save my contract address. ...
0
votes
0answers
45 views

which is a better method to use for signing messages between two parties in web3?

I have been searching for a while for the most secure and supported way for off-chain channel messaging.....so i was using web3.eth.sign(address, keccak256(msg)) for singing messages ....but then used ...
0
votes
1answer
98 views

How to use window function in controller (node.js)?

So this is my users controller to upload a file : exports.postUploadFile = (req, res, next) => { var ethereumURI = req.body.ethereumURI; var abi = JSON.parse(req.body.abi); var ...
1
vote
1answer
136 views

Error when testing the contract

ApprovalContract.sol pragma solidity ^0.5.1; contract ApprovalContract{ address public sender; address payable public reciever; address public constant approver=...
0
votes
1answer
31 views

Do smart-contracts work as APIs?

Is it possible to put a smart contract "behind" a restful API, i.e. expose my contract functions and properties through restuful API where I can make RPC to it? Or does it work as an API already, but ...
1
vote
3answers
276 views

comparing two addresses

I'am trying to create a modifier that allows certain accounts to execute functions. address[] authorized; function verify (address adrs) internal view returns (bool) { bool exist; ...
2
votes
1answer
72 views

ENS name reverse is not working on Ethereum address

I'm trying to both resolve and lookup using "ethjs-ens" the lookup call is working correctly. However, the resolve call is throwing an empty error. The address I'm using on the reverse function is ...
2
votes
2answers
39 views

Troubleshooting a revert on Ropsten

I’ve deployed a contract to Ropsten and am testing it manually with Remix. This transaction reverts for whatever reason (we have unit tests where everything looks fine). In our contract for all of ...
1
vote
2answers
37 views

Contract.deployed() does not work as expected

I use Truffle to test a contract. When i use Contract.deployed() and i fetch address, for example : In a first test, the contract's address is 0x07D899846146b3503dE9D9Dc36B94C2e428eA434 In a second ...
1
vote
0answers
12 views

Oraclize : Calling more than one API independently [duplicate]

There are 2 API 's which has to be called in different time delays recursively. For example : API_1 = 20 mins delay and API_2 = 24 hr delay. How can we call the above 2 API's independently based on ...
2
votes
0answers
15 views

Oraclize ethereum bridge : Notifying __callback tx error to frontend

I have called API dynamically using Oraclize with the delay of 10 minutes. The code is shown below and it works well. uint256 constant DELAY = 60*10; event Log(string result); function ...
1
vote
1answer
77 views

where does the metamask fits in Dapps architecture?

i am learning building Dapps. And i got to know to know about metamask. I've read about metamask is an ethereum wallet which we can use to sign Tx's without running a full node and inject web3 to ...
0
votes
2answers
45 views

Cannot declare web3 object in JavaScript

When I try to declare a web3 object It's always undefined. I'm writting in JavaScript and using Infura as my provider for the ETH mainnet. I also tried with a local blockchain instead of Infura, but ...