I have built a smart contract method to which I pass some sensitive data that needs to be stored on the blockchain and alter the state of the contract. I, the creator of the contract don’t want to be the one paying for the fees of that transaction. I want the user on the browser to approve and pay for
Tag: web3js
Issue in calling a smart contract function with web3
I’m trying to call the createCustomer function provided in this smart contract https://ropsten.etherscan.io/address/0xD3B462CbF6244ed21CD3cF334Bf8CB44A28795A9#code and we basically have to provide three parameters like string memory _hashedEmail, string memory _name and string memory _phone. So I’ve written the following program to call the createCustomer function However it gives me this err which doesnt make any sense as i’ve already provided the three
Calculate Value from JS Promise
I have assigned a callback function to a variable. The function then returns a promise stating it is fulfilled and the value. I want to be able to return the value and use it to perform a mathematical calculation. Javascript code: In the console I get the below output. Answer Assuming this is the interface you’re using, this is an
MetaMask does not inject window.ethereum: Uncaught (in promise) TypeError: Cannot read property ‘request’ of undefined
To start, let me mention this is an in-browser project, so i can only use So a few months …
web3 gives ” Error: Returned error: invalid sender” when broadcasting transaction
I am new to web3 and ethereum blockchain. I tried broadcasting a transaction using the following code but it always gives me an invalid sender error.The sample code is shown below. The error occurs at the below line Please help me know how to fix this problem. Thanks. Answer You can try changing const tx = new Tx(txObject); to const
calling smart contracts methods using web3 ethereum
Trying to work around the blockchain using Ethereum, I’m facing problems when trying to interface with a deployed contract. What I would try to achieve is to call a method to display information added …