Questions tagged [web3j]

Lightweight Java and Android library for integration with Ethereum clients

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

Unable to get campaign.json and campaignFactory.json

const path = require('path'); const solc = require('solc'); const fs = require('fs-extra'); const buildPath = path.resolve(__dirname, 'build'); fs.removeSync(buildPath); const campaignPath = path....
1
vote
0answers
16 views

Error processing transaction request: Number can only safely store up to 53 bits

I have the following code (in clojure): 212 (def CGP 213 (reify ContractGasProvider 214 (getGasPrice [_ contract-func] (BigInteger. "1")) 215 (getGasLimit [_ contract-func] (...
1
vote
0answers
25 views

Error in Ropsten: The network id specified in the truffle config (3) does not match the one returned by the network (1)

There are similar questions but I could not find the solution. maybe because smart contract tools are developing so fast. here is the setting for ropsten in truffle config. ropsten: { ...
0
votes
1answer
24 views

transactions signed always reverted

I don't know how to send a signed transaction against a method payable in Ganache, can someone help me??? When I call the method in Remix it works fine but from Java I get the Hash of the transaction ...
0
votes
0answers
18 views

ETH/BSC Transaction subscribtion

Im connecting to BSC websocket with: let options = { filter: { value: [], }, fromBlock: 0 }; myContract.events.Transfer(options) .on('data', event => console.log(event)) ...
1
vote
0answers
60 views

Encoding ABI function signature in Java using web3j?

Is there a generic way to simply take an ABI function, something like: { "name":"foo", "inputs":{ "interalType":"uint256", "...
0
votes
1answer
92 views

How to sign transaction from frontend with metamask and then send that signed data to rest api for submitting the transaction?

I have a front end connected with metamask wallet and a rest API layer. My requirement is to sign the transaction from metamask and then to send the signed transaction to rest api to submit the ...
1
vote
1answer
28 views

Raw transaction with web3j, tx hash is always null

I'm trying to send raw transaction with Web3j, to call a smart contract function. I try to set very high values for gas to avoid problems with it. But I always get a null tx hash. What is wrong in my ...
0
votes
1answer
27 views

How to access already deployed Smart Contract using Java?

I would like to get information about token. For example total supply and so on. For this I need the contract. However what is the way to actually load it/access it from Java? Checking examples in ...
1
vote
0answers
34 views

Web3ProviderEngine does not support synchronous requests on deploy to private network

I know there are many similar questions, but I've been through all of them and haven't got the answer I'm looking for. I'm trying to deploy a smart contract (that's already been compiled and deployed ...
0
votes
0answers
8 views

Can't invoke a method in a public contract from another contract inside a privacy group using web3j

This is the contract that resides in a privacy group: pragma solidity 0.7.4; import "./Coin.sol"; contract PrivateTransfer { Coin coin; constructor(Coin _coin) { coin = ...
0
votes
1answer
54 views

Delay between IPC transaction call and submitting to mempool

I encountered a problem, where a web3j transaction was successfully submitted via IPC call and yet, it was not submitted to mempool for another 40 minutes. Etherscan did not show the TX as pending and ...
1
vote
0answers
27 views

How do I get the transfer/transaction history of an erc20 token using web3j givin an address

I am not sure how to view the the txhistory of an erc20 token for a specific address. I use a java token wrapper for my erc20 toke as below: public class ERC20 extends Contract { public static final ...
0
votes
1answer
71 views

How to get Ether in private blockchain?

Fast summary: Need a faucet-like funcionality in my private blockchain to give Ether to the newly on-demand created wallets from Android Dapp. I'm working in a project where I've deployed a totally ...
3
votes
1answer
605 views

How to point web3j to other networks such as BSC?

I would like to use web3j and to execute the functions of contracts that are found on Binance Smart Chain. How is this done ? Would it be just Web3j web3 = Web3j.build(new HttpService("https://...
1
vote
1answer
84 views

Retrieve public key of an address to verify off-chain signatures

I have a question regarding use of keys in Ethereum for signing requests/data OUTSIDE of Ethereum. Let's say I have a regular Ethereum EOA with an address and keypair. I now want to have a piece of ...
1
vote
0answers
89 views

eth_estimateGas Error when balance of an account < the amount to send in a transaction

I have used the following request to estimate gas in an ETH transaction in Ropsten. ## JSON-RPC over HTTPS POST curl https://ropsten.infura.io/v3/YOUR-PROJECT-ID \ -X POST \ -H "Content-...
1
vote
1answer
150 views

How to specify Solidity version in web3j?

I have a simple java maven project whose pom.xml looks like: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" ...
0
votes
1answer
77 views

Execution Reverted Details

I am writing code in Java and trying to calculated potential gas units, for a function call on my methods. I am trying to do so by using infura as a provider for my web3 Instance, and then created a ...
0
votes
1answer
288 views

How do i import my ethereum wallet just using private key?

Help me out how do i resolve the issue of ethereum smartcontract for getting my wallet when i enter my private key in the text area Use WalletUtils functionality The WalletUtils class can be used to ...
0
votes
0answers
20 views

Development of ethereum payments system

I'm in need of some help! I'm developing a project where I'm supposed to implement an ethereum payment system that will then be installed in a point of sale (POS) in a retail store. The idea is not to ...
1
vote
1answer
767 views

How to use Web3j call Multicall Contract?

I need to use Multi Call contract to merge multiple calls,Its address on the mainnet is 0x2cc8688C5f75E365aaEEb4ea8D6a480405A48D2A contract Multicall { struct Call { address target; bytes ...
0
votes
0answers
70 views

org.web3j.protocol.exceptions.ClientConnectionException: Invalid response received: okhttp3.internal.http.RealResponseBody

Environment Android Studio Infura – Rinkeby test network Web3J Metamask Rinkeby.etherscan.io I am trying to build an Android app to read and write smart contract by following the medium article: ...
1
vote
2answers
69 views

TransactionException: Cannot unmarshal invalid hex string when deploying contract in web3j

I have a java server that uses web3j library with geth as the provider. When I tried to deploy my contract on my private test net. I got this error: org.web3j.protocol.exceptions.TransactionException: ...
0
votes
1answer
139 views

Web3j generate command not running

I am trying to generate a java wrapper class for a solidity contract, I have compiled the file and have the abi and bin file, but when I run the command as follows: web3j solidity generate ...
1
vote
1answer
117 views

web3j command-line does not recognize flags

I am trying to run the command such as web3j solidity generate -b SimpleBank/SimpleBank.bin -a SimpleBank/SimpleBank.abi -o ~/IdeaProjects/quiknode/src/main/java/ -p com.simplebank Found here: https:/...
1
vote
1answer
26 views

How to properly close web3 after execution? - Java

Here is what I am trying to do: String amt = Web3j.build(new HttpService("https://ropsten.infura.io/v3/123blahblah")) .ethGetBalance("0xblahblah", DefaultBlockParameterName.LATEST) ...
1
vote
0answers
133 views

org.web3j.protocol.exceptions.ClientConnectionException: Invalid response received on web3j on Android

I am trying to execute transactions by calling my RegisterNewUser function in the deployed smart contract through Android and I am using Infura. However, when I run, there is an error as seen below : ...
1
vote
1answer
33 views

Unable to executive function of smart contract on android studio java file

I am trying to execute some functions of my deployed contract in Android Studio through a Java file. I have generated Java Wrapper files. However, when I run Android Studio, there is no data added to ...
0
votes
0answers
97 views

Cannot generate java wrapper class from contract

currently I am trying to generate a java wrapper contract from my smart contract. The command I use is as seen below : web3j truffle generate --javaTypes C:\Users\name\Documents\test\...
0
votes
0answers
127 views

Verifying ethereum message signatures with java

I am using web3j to verify message signatures but there are some false negative results. For example this signature should be right, but it seems like the address could not be recovered: final ...
1
vote
0answers
15 views

Contracts invoked asynchronously are not packaged as transactions [closed]

I use the sendAsync() method to call the contract asynchronously. If I loop through the method several times, without using get(), the number of packaged transactions is less than the number of calls, ...
0
votes
2answers
230 views

Contract Call has been reverted by the EVM with the reason: 'execution aborted (timeout = 5s)'

I defined an array of objects in the Ethereum smart contract. An object is a structure that is inserted into the array every time a function is called.When 80,000 data is inserted, it takes a long ...
4
votes
2answers
755 views

Problems calling Smart Contract function in Java using Web3j

I am rather new to writing/using smart contracts in Java and I am currently trying to use my smart contract. I already wrote and tested it, compiled it, deployed it to Ropsten, and built my Java class ...
1
vote
0answers
64 views

Ethereum account for HD Wallet key generated with xpub key only using bitcoinj

Accordingly to the BIP32/BIP44 specification recommendations I generating HD Wallet addresses using bitcoinj library (DeterministicKey instances) with the path like M/44'/60'/0'/0/0 using xpub key ...
1
vote
1answer
63 views

How to catch a solidity event from Java

I am trying to make a decentralized android application. It is an online two player Tic-Tac-Toe game. I have implemented the back-end with solidity and a part of the front-end in android studio. ...
1
vote
0answers
41 views

smart contract Thether balanceOf method returns 0x

i used web3j-java call Tether contract method balanceOf(the server node is mine , and on ether mainnet),my address has 3USDT,but i call balanceOf , the node returns me 0x as the balance value,it is ...
2
votes
0answers
42 views

events and relationships between smart contracts and oracle smart contracts [closed]

How to subscribe a web3j client node to a smart Oracle contract event? Do I need the Oracle contract address?
2
votes
1answer
806 views

Error processing transaction request: already known

I'm developing an application with which you can make ERC20 token transfers. When you make transfers from one account to another with a reasonable time between transfers it works correctly. But when ...
1
vote
0answers
25 views

How can i get the name of an emitted event through the event abi (log entry, topics) of solidity?

I want to get the name of an emitted event from my contract using the event abi and web3j. This is the contract i'm using as an example for this question: pragma solidity ^0.5.7; contract ...
0
votes
1answer
50 views

The transaction can get from Web3j but display as failed in Etherscan

How could I get the real status from EthBlock.TransactionObject(replayPastBlocksFlowable) in Web3j as same as Etherscan? I couldn't find any status items from Web3j response, how does Etherscan check ...
0
votes
0answers
186 views

Listen to latest event emitted by smart contract with web3j API in JAVA

I'm having a smart contract: pragma solidity ^0.4.21; contract NodeServie{ event triggerEvent(address indexed _sender, string randomStr); function callEventFunc(string str) public{ ...
0
votes
1answer
137 views

Revert error on delegated transfer function

Here is my code base, first I am deploying the tokenPS contract on the tesnet which generates an addr(0xaddr) and then I am deploying the caller contract. In caller contract when I am trying to ...
1
vote
1answer
122 views

How to subscribe to transaction with a smart contract in web3js?

I am trying to write a web3js code. I have already written it using web3j (java) and now i want to do exactly same thing but using web3js. I have seen documentation and stuff, but i am not able to ...
2
votes
1answer
694 views

How to get contract object using ABI json and address with web3j?

I worked with web3js(JavaScript) and used web3.eth.Contract with 2 params (json, address) and successfully got contract object. Now I started to work with web3j(Java) and don`t understand how I have ...
0
votes
1answer
667 views

Attempting to transfer erc20 token, but keep encountering insufficient funds for gas * price + value

I'm attempting to transfer an erc20 token, but keep running into insufficiant funds for gas * price + value, regardles of how much eth I have, I also have an estimate function which returns a value ...
0
votes
1answer
43 views

How to reliably send transaction via web3j while connection is poor?

I use Transfer.sendFunds(Web3j, Credentials, BigDecimal, Convert.Unit) to transfer money. Usually I convert it to flowable. Flowable/RemoteCall completes when transaction is included in block (...
1
vote
1answer
283 views

What is the equivalent of “buildTransaction” of web3Py in web3JS?

I'm using Node to interact with my smart contract. I understand that I need to first sign my transaction before sending it. In one of the StackExchange answers I see that it can be done using ...
0
votes
1answer
89 views

web3j - Java - Resolve ENS Name to Contract Address

I am trying to Resolve my ENS Name to the corresponding Contract Address. But so far I get the error org.web3j.tx.exceptions.ContractCallException: Empty value (0x) returned from contract I am using ...
2
votes
0answers
167 views

How can I calculate gas price and gas limit programmatically using web3j [duplicate]

I am using following code to deploy my smart contract but now my transaction is taking too much time to mine on my private blockchain. String contractAddress = myContract.deploy(web3j, credentials, ...

1
2 3 4 5
7