Closed coffeemuggg closed 3 years ago
Is it possible for you to share your contract and the Javascript code you used to deploy the contract? Thanks
yep, but I am not using javascript I am using the Web3j library.
private void createNft(){
OkHttpClient okHttpClient = new OkHttpClient.Builder()
.readTimeout(5, TimeUnit.MINUTES)
.connectTimeout(5, TimeUnit.MINUTES)
.writeTimeout(5, TimeUnit.MINUTES)
.build();
Web3j web3 = Web3j.build(new HttpService("https://eth-rpc-api-testnet.thetatoken.org/rpc", okHttpClient));
try {
Credentials credentials = WalletUtils.loadCredentials(
"password1",
"src\\main\\resources\\0x78e2d2e2a915158f596578892A54a4CfBD7A78F4.keystore"
);
FastRawTransactionManager txMananger = new FastRawTransactionManager(web3, credentials, 365);
Minty.deploy(
web3,
txMananger,
new CustomerGasProvider(),
"MintyNFT",
"MINTY",
"test token",
"1634822440",
"https://i.imgur.com/n7GdlOO.jpeg",
"https://i.imgur.com/n7GdlOO.jpeg"
).send();
} catch (Exception e) {
e.printStackTrace();
}
}
public class CustomerGasProvider extends StaticGasProvider {
public static final BigInteger GAS_LIMIT = BigInteger.valueOf(10000000L);
public static final BigInteger GAS_PRICE = BigInteger.valueOf(4000000000000L);
public CustomerGasProvider() {
super(GAS_PRICE, GAS_LIMIT);
}
}
Contract:
Maybe there is a problem with the generated wrapper? Not sure
After whole day of debugging entire app I have figured out the issue :)) Generated wrapper code with the web3j cli gives returns json, but to sign the transaction successfully I needed only the byte code (not very clear in the docs unfortunately). Figured it out by checking the thetajs sourcecode. Can finally sign and create directly from android app :D
Good to hear you sorted it out! :)
I'm trying to deploy my contract on the Testnet but I am getting this error, any idea why?