Hello team!
I am trying to modify the parameters that the smart contract needs to be deployed, but I have some bugs in the Java part.
Here is one of the changes in a simplified way:
Implementing the metadata standard for smart contracts (Contract-level metadata)
Solidity
I will omit the variable declaration and operation. The problem is with the constructor.
constructor(
string memory uri,
string memory contractName,
string memory contractSymbol,
string memory contractUri,
) ERC1155(uri) {
name = contractName;
symbol = contractSymbol;
scUri = contractUri;
}
Ardor
File: AssetsErc1155Peg.java
Line: 382
if (pegContext.initializationError != null) {
if (pegContext.initializationError.equals(CONTRACT_ADDRESS_MISSING_ERROR) && DEPLOY_ETH_CONTRACT_COMMAND.equals(command)) {
return pegContext.deployEthContract(context,
getParameter(context, requestParams,"uri"),
getParameter(context, requestParams,"name"),
getParameter(context, requestParams,"symbol")),
getParameter(context, requestParams,"contractUri"));
} else {
return context.generateErrorResponse(10004, "Peg initialization error " + pegContext.initializationError);
}
}
Line: 1118
private JO deployEthContract(AbstractContractContext context, String uri, String name, String symbol, String contractUri) {
try {
BigInteger ethGasPrice = getEthGasPrice();
ERC1155MintBurn contract =
ERC1155MintBurn.deploy(web3j,
createTransactionManager(params, ethBlockedAccount, false),
new StaticGasProvider(ethGasPrice, DefaultGasProvider.GAS_LIMIT),
Convert.nullToEmpty(uri), Convert.nullToEmpty(name), Convert.nullToEmpty(symbol), Convert.nullToEmpty(contractUri)).send();
JO response = new JO();
response.put("ethContractAddress", contract.getContractAddress());
return response;
} catch (Exception e) {
Logger.logErrorMessage("Exception while deploying", e);
return context.generateErrorResponse(10500, "" + e);
}
}
The error I have when deploying the contract, with deployEthContract is the following:
"errorDescription": "java.lang.NoSuchMethodError: 'org.web3j.protocol.core.RemoteCall com.jelurida.web3j.generated.ERC1155MintBurn.deploy(org.web3j.protocol.Web3j, org.web3j.tx.TransactionManager, org.web3j.tx.gas.ContractGasProvider, java.lang.String, java.lang.String, java.lang.String, java.lang.String)'",
Java and Solidity code compiles perfectly. The contract is deployed in Ardor is deployed as well.
The problem is only when using deployEthContract
Thank you!