0

I'm trying to deploy a smartcontract on Rinkbey. I've followed the official documentation and some tutorials. I implemented the following code in my android studio but contract.deploy returns nothing.


private fun connectWithRinkBey() {
//        web3j = Web3j.build(InfuraHttpService(rinkBeyUrl))
        val web3j = Web3j.build(HttpService("https://rinkeby.infura.io/v3/786cbf2ff21241c583732b7a1741880a"))
        try {
            val clientVersion = web3j.web3ClientVersion()
                .sendAsync().get()
            if (!clientVersion.hasError()) {
                Toast.makeText(this, "Connected", Toast.LENGTH_LONG).show()
                Log.d(TAG, "deployContract2: Starting")
                Log.d(TAG, "deployContract2: ${deployContract2()}")
                Log.d(TAG, "connectWithRinkBey: Ending")

            } else {
                Toast.makeText(this, clientVersion.error.message, Toast.LENGTH_LONG).show()
            }
        } catch (e: Exception) {
            Toast.makeText(this, e.message, Toast.LENGTH_LONG).show()
        }
    }

private fun deployContract2(): String {
        val transactionManager = RawTransactionManager(web3j, getCredentialsFromPrivateKey())
        val contractGasProvider = StaticGasProvider(gasPrice, gasLimit)
        return Trust_sol_Trust.deploy(web3j, transactionManager, contractGasProvider)
            .send()
            .contractAddress
    }

1
  • Rinkeby Deprecated.
    – DevABDee
    Aug 13, 2022 at 10:57

1 Answer 1

0

Rinkeby is almost deprecated. Check this warning. Migrate your contracts and deploy new ones on Goerli or Sepolia. The only two testnets developers will maintain after the merge.

1
  • Rinkeyby is working fine in Javascript. Aug 13, 2022 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.