Majd TL
  • Member for 3 years, 11 months
  • Last seen this week
  • Stuttgart, Deutschland
web3 - get contract from transaction object
1 votes

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,...

View answer
Call state modifying function in view function
1 votes

the answer is no. it will not compile view functions cannot modify the state and the compiler check this and give you back TypeError: Function declared as view, but this expression (potentially) ...

View answer
What's the possible errors (or warnings) that a developer can face when deploys a smart contract into the Ethereum network?
Accepted answer
1 votes

Some of errors for deploying smart contract or just send a tx Out of gas > The "out of gas" error occurs when all the gas you allotted for the transaction is consumed before the ...

View answer
How do I find the transaction success from a receipt?
Accepted answer
1 votes

I use this code import Logic.Connection.HttpClient; import org.web3j.protocol.Web3j; import org.web3j.protocol.core.methods.response.EthGetTransactionReceipt; import org.web3j.protocol.http....

View answer
remix "no contract compiled yet" although contract is error free
1 votes

you should open the contract file and klick on compile

View answer
Status: Fail, Out of Gas
1 votes

You changed the gas limit to 32000 which is too low for this function to operate.. the $8 cannot be refunded. Simple example (1 gas is 1 lego piece) To build a house you need 150000 lego pieces (just ...

View answer
Sending transaction with web3.js
1 votes

You are not providing too much informations for me to give you an easy way to do that :) , anyway this is one way to how you can send transaction: Better to use web3 1.0, you need also install ...

View answer
How to read the return object of call to function in a contract?
Accepted answer
1 votes

There are different types of functions in solidity, a normal function external (public) functions those are used to change the state of a contract and could emit events. those functions require to ...

View answer
How to reset private ethereum blockchain (Geth)?
1 votes

Run the private ethereum chain in a docker container... and then you can throw the container or its data and deploy it again in a matter of seconds those are some examples of how to run a private ...

View answer
Deploying a smart contract using transaction manager in web3j
1 votes

With web3j and similar by webjs You need the binary code of your contract... you can generate the java wrapper class of your contract with web3j command-line and it always includes the needed Binary ...

View answer
Not able to add 'replayPastTransactionsFlowable' transaction logs result into an collection List object using Web3j java?
1 votes

Try this import java.math.BigInteger; import org.springframework.web.bind.annotation.*; import org.web3j.protocol.Web3j; import org.web3j.protocol.core.DefaultBlockParameterName; import org.web3j....

View answer
How to use gas price for faster transaction in erc20 transafer event?
1 votes

you need a new class that implements the StaticGasProvider (the value of gaslimit is just an example, you don't usually need that much for a transfer transaction) import org.web3j.tx.Contract; ...

View answer
invalid number value for power of 18
1 votes

javascript cannot handle those big numbers, Use the method web3.utils.toWei(number [, unit]). const amount = web3.utils.toWei(1, 'ether');

View answer
it'll give me a parser error
1 votes

First: the modifier come after the function, so it will be function fisrtcoin() public { deployer = msg.sender; } Second user constructor key word, so it will be constructor() external { ...

View answer
Issue with Serverless deploy of smart contract-Dependency mismatch -Package.json,Package-lock.json error
1 votes

Try to Upgrade web3 to 1.0.0-beta55 and add "null" as second parameter like this const web3 = new Web3('http://......', null, options);

View answer
Producing a Hash of a File
Accepted answer
1 votes

First you need to write and deploy a simple storage smart-contract (with solidity and truffle), then you need to use the web3js library to connect to the blockchain and later to call your function in ...

View answer
Error encoding arguments: SyntaxError: Unexpected token e in JSON at position 2 while string concatenation
Accepted answer
1 votes

You Error is in the second for, it should be _valueBytes[i], and use pure in your function pragma solidity ^0.5.1; library Strings { function concat(string memory _base, string memory _value) ...

View answer
Compilation Error: Error: Expected identifier but got '(' msg.sender.transfer(uint(amount));
Accepted answer
1 votes

no compile errors, but not the best code and way to do that pragma solidity ^0.5.1; contract Signed1 { uint val = 0; mapping (address => bool) transferred; function withdrawOnce(int ...

View answer
condition check of struct mapping in solidity?
1 votes

following some simple style guide will make your question more easier to understand and solve!, as goodvibration in comments said, that is not the best way to store a user and check if he/she exists ...

View answer
How to create a wallet file for existing account&
1 votes

you don't need always a wallet file, you can do something like this /** * system wallet. */ private Credentials credentials; /** * Get wallet from PrivateKey. * @param privateKeyInHex the ...

View answer
Getting the transaction hash on function call
1 votes

with that simpleStorage contract, you are storing a value in a smart contract on the blockchain. So User B need only the address of that deployed smart contract and then he could call the method get() ...

View answer
Transaction completion in Ethereum smart contract
1 votes

You cannot calculate the time, which the transaction will need to be mined and stored in a block. Each 15 second (main net) a new block is generated and it is up to the miners (how much fees you are ...

View answer
Transaction no confirmed and JUnit test assert fail
1 votes

Maybe this could help you if you are stuck here, It is not the solution but you can do something like this. (worked for me with web3 "idk about Quorum") For example if you have a transfer(..) ...

View answer
A single exception in Truffle test causes every other test cases to fail
1 votes

Use the truffle assertions library and as goodvibration said don't forget the await const truffleAssert = require('truffle-assertions'); ... it('should fail', async function () { await ...

View answer
Can't send ETH to ERC20 contract
Accepted answer
1 votes

I think it is too much for a fallback function https://solidity.readthedocs.io/en/v0.5.3/contracts.html In the worst case, the fallback function can only rely on 2300 gas being available (for ...

View answer
Error: Node error: {"code":-32015,"data":"Reverted 0x","message":"VM execution error."}
1 votes

use send and not call myContract.methods.myMethod([param1[, param2[, ...]]]).send(options[, callback]) Send -> Will send a transaction to the smart contract and execute its method. Note this can ...

View answer
Empty value (0x) returned from contract web3j
1 votes

use the load(...) method from SampleContract Wrapper and then call getSample() I can't test it now but it should look something like this // your code for deploy and wait until it deployed ...

View answer
transactionHash returned null sometimes when trying to transfer funds using web3j (random behaviour)
1 votes

There is a function that can give you the estimated gas of a transaction web3j.ethEstimateGas(Transaction transaction) But I think, even if you set a very high gas limit, you bay only for the used ...

View answer
How to check if geth node is running ,from web3j code
Accepted answer
1 votes

try { Web3j web3j = Web3j.build(new HttpService("LINK-TO-YOUR-NODE")); // this will cause the exception if web3j is not connected LOG.info("Connected to Ethereum client version: " +...

View answer
How do i create a wallet from a smart contract in Solidity?
1 votes

That is no possible. I guess because generating the privateKey is costly. But you can generate first a wallet localy with web3 and then with solidity deploy a smart contract that get the address of ...

View answer