New answers tagged

0

What you are trying to do will never work, find another way :) see the graph protocol or other resources that work to index the blockchain. Back to the Question: There is a difference between from, to, value in the transaction and the from, to, value in the logs included in the transaction receipt web3.eth.getTransaction('0x9fc7641.....').then(console.log); ...


0

turns out it was just me being stupid! I was trying to run the transaction with an outrageously low amount of ether (4 gwei) which is, of course, so small that it can't be seen in the Ganache app. The reason I was seeing no new coins being created was because my conversion code rounded the result to 0.


0

Those data are very important because if an attacker can change them, it can steal ETH from my user. This is incorrect. Only exposing a private key can lead to lost assets. Is there a way to run NodeJs with ABI+Contract address encrypted, and decrypt them with a passphrase ? ABI and contract address are already public information and there is no point to ...


1

With the JavaScript code you provided in the question, you just can define the given contract. You need to use another method of web3 that executes a solidity function. For executing a solidity function with web3 methods you should try a command like this: contract_name.methods.function_name(<arguments ...>).send({from:<sender address>, value:<...


1

To see a contract's values in browser with web3, you should create some .jade file. For interacting with a smart contract from a browser, the workflow is this: There are 3 levels: 1) Blockchain level, 2) Nodejs level, and 3) UI/browser level. In "blockchain level" there is the given smart contract (that you have it). In "Nodejs level" ...


1

You required web3 module but used a method of truffle-contract module while you didn't require it. So, you just can use all methods that web3 provides to you. The command: var theContract=contract_object.new({ from: address, data:contract_byteCode, gas: gasEstimate+10000}) uses truffle-contract module's method. Just replace that with the below command that ...


0

I was able to resolve this by removing - from the script name, deleting node_modules folder and package.json and forcing npm cache clean. Also placed the script in an external folder.


0

The problem is that you are sending the transfer message to the token recipient address. To execute a function from a contract the transaction has to target the contract address. const token = new web3.eth.Contract(abi, My_Contract.networks[4].address) const txObject = { .. to: '0x153ed6D60AcaE6E915907233F10663462FF67622', // <--- Recipient ....


Top 50 recent answers are included