Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [java]

Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible.

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

How to decode and parse (via ABI) ethereum transaction in JAVA

I am currently passing the Ethereum serialized raw transaction to https://github.com/flightwallet/decode-eth-tx to get output like: { "nonce": 0, "gasPrice": null, "...
user avatar
0 votes
0 answers
28 views

Create a wallet with Web3j spring boot

I create a wallet using Web3j and I'm able to send Ether between to accounts in my private ganache server but if y try to use a wallet created by my code I can send the ether to my wallet but can't ...
user avatar
0 votes
1 answer
44 views

how to use the value of msg.value and msg.sender of a contract, when a function calls a different contract

I'm studing Solidity and tring to understand how it works. Starting from Safe Remote Purchase in the "Solidity section by example" the doc (https://docs.soliditylang.org/en/v0.8.12/solidity-...
user avatar
  • 3
0 votes
0 answers
57 views

web3j: how to estimateGas before sending transaction

I am working with web3j, and I have the following code to send a transaction and get its receipt: TransactionReceipt mr = contract.mintTo(WALLET1_ACCOUNT1_PUBKEY, tokenURI, tokenId).send(); But I ...
user avatar
1 vote
0 answers
12 views

Stable release of Hyperledger Besu won't compile

I cloned a fresh copy of Hyperledger Besu from the GitHub repo and when I opened it in Eclipse, it said that there are 148 errors and that the project won't compile. It also said that there are 108 ...
user avatar
0 votes
1 answer
76 views

org.web3j.protocol.exceptions.ClientConnectionException: Invalid response received: 403; error code: 1020

I have very simple java code using web3j library. I am using mumbai test network for polygon. After calling String chainId = web3j.netVersion().send().getNetVersion(); line I get error that is written ...
user avatar
1 vote
1 answer
240 views

Error while using ERC-20 java library: "only replay-protected (EIP-155) transactions allowed over RPC"

I am trying to make simple transaction using ERC-20 java library. I use mumbai test network for polygon. Code transfers stablecoin from one wallet from another. During approve method call I get ...
user avatar
0 votes
1 answer
30 views

Cannot resolve symbol "ipfs' android

Hello i am trying to send some files from android to IPFS.I am following this article on medium but can't import packages that are required ` import io.ipfs.api.IPFS; import io.ipfs.api.MerkleNode; ...
user avatar
  • 137
0 votes
1 answer
137 views

Monitor for all events

It is possible to monitor for all events that happens on Ethereum network or Binance Smart Chain network (BSC). I know that would be a lot of data however I would like later to filter that data. If ...
user avatar
  • 101
0 votes
1 answer
50 views

Start and HTTP JSON-RPC geth on android?

Is it possible to change the code in /mobile to allow for a json-rpc api to be spawned on an android? Or is there something I need to do in Java with the NodeConfig? I already managed to run a light-...
user avatar
1 vote
0 answers
151 views

Can I get the IPFS hash from file (without uploading it & with java)?

As far as I'm concerned IPFS client uses the resulting SHA-256 hash from files, and also compatible with others, to index them in the IPFS Protocol. My problem is that I'm not sure how to consistently ...
user avatar
  • 584
0 votes
0 answers
60 views

How do I start a light Ethereum Node on Android?

I would like to program an android app which has a built in light-node with its own JSON-RPC API and connected to mainnet. Does anyone know if this is possible?
user avatar
1 vote
0 answers
19 views

Trouble implementing ERC20 payment service in android application

I have been following this tutorial (https://medium.datadriveninvestor.com/a-primer-to-ethereum-token-development-using-java-and-web3j-52b24cc6c403) but seem to keep running into errors when it comes ...
user avatar
0 votes
0 answers
19 views

Most secure language for building Ethereum wallet

I'm interested in building an ethereum wallet as my next project and wanted to use Java and ethers.js. Is this a good idea or is there a better language I should use? I'm familiar with Java and ethers....
user avatar
  • 91
0 votes
1 answer
232 views

Web3j, how to correctly byte encode multiple data?

I am interacting with a smart contract and i do not understand correctly how to encode the data using Web3j to interact with the smart contract since I had never interacted with a contract that ...
user avatar
  • 1
1 vote
0 answers
99 views

Web3j - How to read the contract without credentials?

I'm using Web3j to interact with my deployed smart contract. I've deployed my contract onto the testnet and can interact with it, however using the generated wrapper code, it requires my wallet. Web3j ...
user avatar
1 vote
0 answers
20 views

How can I add an option to pay with cryptocurrency in an android app using Java? [duplicate]

For my college assignment I have been tasked with creating an app that among other things allows a user to pay for services using an ICO Token (ERC20 contract), How do I go about doing this? The ...
user avatar
2 votes
0 answers
358 views

How to verify signature on server backend with web3j?

I am sending an EIP_712 signature from metamask to the java backend (web3j) and I need to verify it on backend java application. In this topics it is discussed the support of EIP-712 in java (web3j): ...
user avatar
1 vote
0 answers
18 views

Encode String to byte[] to invoke method via web3j

I have a method in a contract that receives a bytes object. Web3J generated code in Java translates it to a byte[] object as parameters. I have the correct String "0x....." thet represents ...
user avatar
  • 11
0 votes
0 answers
39 views

How can there be multiple FROM addresses in one contract?

As I understood, there cannot be several senders for eth. How to make such a contract? For example, here is a transaction with several addresses, this is a swap, but it's still not clear how: https://...
user avatar
1 vote
1 answer
3k views

How do I add minting functions to my webpage?

I'm looking at adding a mint function on my website so that users can directly mint from my website straight to the contract such as this: https://campfirebear.club/mint is this just written in JS ? ...
user avatar
  • 11
0 votes
1 answer
463 views

Java Keccak 256 hashing implementation of multiple inputs

What's the best way to achieve the equivalent hashing in Java as below in Solidity? keccak256(abi.encodePacked(arg1,arg2,...))
user avatar
0 votes
2 answers
378 views

how to build Defi app from A to Z

I'm a java developer and a newbie with blockchain. I want to build a simple Defi app with a simple smart contract. please tell me know steps by steps to do that? how to setup environment? which the ...
user avatar
0 votes
2 answers
436 views

Get the same result of abi.encode function in Java

let say we have the following function in solidity: function tryAbiEncode (address _address, uint8 _amount) public pure returns (bytes memory) { return abi.encode("\x19Ethereum Signed ...
user avatar
1 vote
0 answers
56 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] (...
user avatar
0 votes
1 answer
95 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 ...
user avatar
1 vote
1 answer
674 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", "...
user avatar
1 vote
1 answer
437 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 ...
user avatar
  • 111
1 vote
0 answers
147 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 ...
user avatar
1 vote
1 answer
568 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" ...
user avatar
  • 131
0 votes
1 answer
424 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 ...
user avatar
2 votes
1 answer
3k 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 ...
user avatar
  • 31
1 vote
2 answers
216 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: ...
user avatar
1 vote
1 answer
340 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:/...
user avatar
1 vote
1 answer
113 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 ...
user avatar
  • 11
0 votes
0 answers
264 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\...
user avatar
  • 11
1 vote
1 answer
865 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 ...
user avatar
1 vote
0 answers
233 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 ...
user avatar
  • 81
0 votes
1 answer
1k 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 ...
user avatar
0 votes
1 answer
130 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 (...
user avatar
0 votes
0 answers
93 views

Ethereum address(generated) and ecrecover computed address is not matching

I created the Ethereum address by following the below steps . 1. Generated a public key(ECDSAsecp256k1) from HSM. 2. Generated a Keeccak256 hash of Q point of ECPublicKeyParameters ...
user avatar
0 votes
0 answers
46 views

where to host my Java web app to fully decentralised?

I need a idea to host my webapp to be on some secure distributed network. my client doesn't want to deployed on aws or gcp. he wants it to be on decentralised network p2p. Your suggestion and advice ...
user avatar
0 votes
0 answers
38 views

org.web3j 4.5.18 ethGetBalance get stuck

I'm using the following simple code in order to obtain the wallet balance: Credentials credentials = Credentials.create(privateKey); web3.ethGetBalance(credentials.getAddress(), ...
user avatar
0 votes
1 answer
251 views

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

I'm trying to create an api where i have to provide transaction logs in json objects but im unable to add result of replayPastTransactionsFlowable into an collection object @GetMapping("/test") ...
user avatar
  • 86
1 vote
0 answers
888 views

How to get Ethereum transaction list by address in java web3j quickly?

Im trying to fetch transaction logs from ganache using web3j library to send it as an api ,is there any way where i can get all transactions from ganache quickly? @GetMapping("/test") public List&...
user avatar
  • 86
0 votes
1 answer
392 views

How to use gas price for faster transaction in erc20 transafer event?

I'm trying to provide a customised gas price for faster transaction ,how can achieve that ? Web3j web3 = Web3j.build(new HttpService("http://")); ERC20 javaToken = ERC20.load(contractAddress,...
user avatar
  • 86
1 vote
0 answers
255 views

Not able to decode the input data from transaction using web3j (Java)

I am creating transactions using web3j and passing some private data in that transaction. The transaction is also getting mined . I have subscribed to the mined blocks, where I am fetching the ...
user avatar
  • 86
1 vote
1 answer
823 views

How to decode InputValue of ethereum using java web3j

**I'm trying to decode the inputValue of an transaction using web3j without using any contract abi and wrapper class,Im loading the contract using its contract address ,is there any way/inbuilt ...
user avatar
  • 86
1 vote
2 answers
959 views

Unable to invoke smart contract function from Web3j contract wrapper

I've been learning about interacting with smart contracts through Android and the Web3j framework but have run into an issue. I'm trying to mint an ERC721 token and send it to an address but it doesn'...
user avatar
  • 11
1 vote
1 answer
72 views

how can i fetch all the tokens from ethereum network to my wallet ?using web3js(nodejs) or web3j(java)?

I'm trying to fetch all the available tokens from ethereum network into my android wallet but could not able to find an suitable solution other than web scrapping
user avatar
  • 86