Android web3j Contract.isValid: false

29 Views Asked by At

I am using Android to call a smart contract, following the official Wed3j tutorial. However, after loading the contract, it prompts Contract.isVail=false; And calling the contract method directly will time out. How should I do?

dependents:

    implementation ("org.web3j:core:4.10.0")

code:

String rinkebyUrl = "https://rpc-mumbai.maticvigil.com/";
HttpService httpService = new HttpService(rinkebyUrl);
private String contentAddress = "0x6cf0cc59afefaa7ca5ef53127681fb1ab6f632e3";
Web3j web3j = Web3j.build(httpService);
Credentials credentials = Credentials.create(walletPrivateKey);
RawTransactionManager manager = new RawTransactionManager(web3j, credentials, chainId);
contract = ContractOBJ.load(contentAddress, web3j,manager, new DefaultGasProvider());
contract.isValid(); // is false;
contract.method().send() // timeout

Successfully connected to the smart contract and executed the methods within it

0

There are 0 best solutions below