# Bridge | Parameters when deploying

**URL:** <https://talk.jelurida.com/t/bridge-parameters-when-deploying/869>\
**Category:** Developers\
**Created:** [17 March 2023 16:39 UTC](https://talk.jelurida.com/t/bridge-parameters-when-deploying/869 "2023-03-17T16:39:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![6DeadSky9](https://talk.jelurida.com/user_avatar/talk.jelurida.com/6deadsky9/32/288_2.png) [@6DeadSky9](https://talk.jelurida.com/u/6DeadSky9)\
**Post date:** [17 March 2023 16:39 UTC](https://talk.jelurida.com/t/bridge-parameters-when-deploying/869/1 "2023-03-17T16:39:51Z")

</div>

**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](https://docs.opensea.io/docs/contract-level-metadata))

**Solidity**  
I will omit the variable declaration and operation. The problem is with the constructor.

```auto
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

```auto
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

```auto
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!**

---

<div class="post-metadata">

**Author:** ![petko.petkov](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/p/eb8c5e/32.png) [@petko.petkov](https://talk.jelurida.com/u/petko.petkov)\
**Post date:** [17 March 2023 16:54 UTC](https://talk.jelurida.com/t/bridge-parameters-when-deploying/869/2 "2023-03-17T16:54:06Z")

</div>

So you are adding a `contractUri` parameter to the constructor but the Java wrapper is not updated. Try to call the `generateContractWrappers` gradle task manually. Unfortunately, due to the limits of the Ardor contract size, significant portion of the contract code, together with the generated wrappers must be deployed as a library - `erc1155-0.0.1.jar`. So first check if the wrappers were correctly generated and the method `com.jelurida.web3j.generated.ERC1155MintBurn.deploy` which is in `erc1155-0.0.1.jar` has the correct parameters. Then make sure the ardor contract executes with this library in class path and not some old one.

---

<div class="post-metadata">

**Author:** ![6DeadSky9](https://talk.jelurida.com/user_avatar/talk.jelurida.com/6deadsky9/32/288_2.png) [@6DeadSky9](https://talk.jelurida.com/u/6DeadSky9)\
**Post date:** [17 March 2023 17:31 UTC](https://talk.jelurida.com/t/bridge-parameters-when-deploying/869/3 "2023-03-17T17:31:01Z")

</div>

It seems that if the parameters are updated... another place to look?

```auto
public static RemoteCall<ERC1155MintBurn> deploy(Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider, String uri, String contractName, String contractSymbol, String contractUri) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Utf8String(uri), 
                new org.web3j.abi.datatypes.Utf8String(contractName), 
                new org.web3j.abi.datatypes.Utf8String(contractSymbol), 
                new org.web3j.abi.datatypes.Utf8String(contractUri)));
        return deployRemoteCall(ERC1155MintBurn.class, web3j, credentials, contractGasProvider, BINARY, encodedConstructor);
    }

    public static RemoteCall<ERC1155MintBurn> deploy(Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider, String uri, String contractName, String contractSymbol, String contractUri) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Utf8String(uri), 
                new org.web3j.abi.datatypes.Utf8String(contractName), 
                new org.web3j.abi.datatypes.Utf8String(contractSymbol), 
                new org.web3j.abi.datatypes.Utf8String(contractUri)));
        return deployRemoteCall(ERC1155MintBurn.class, web3j, transactionManager, contractGasProvider, BINARY, encodedConstructor);
    }

```

---

<div class="post-metadata">

**Author:** ![petko.petkov](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/p/eb8c5e/32.png) [@petko.petkov](https://talk.jelurida.com/u/petko.petkov)\
**Post date:** [17 March 2023 17:39 UTC](https://talk.jelurida.com/t/bridge-parameters-when-deploying/869/4 "2023-03-17T17:39:26Z")

</div>

To get that `java.lang.NoSuchMethodError`, the `ERC1155MintBurn.class` in `erc1155-0.0.1.jar` is not compiled from the code you pasted. Check why. Maybe you didn't copy the new version to the lib directory of the Ardor installation, or you didn't restart the Ardor node. Not sure.

---

<div class="post-metadata">

**Author:** ![6DeadSky9](https://talk.jelurida.com/user_avatar/talk.jelurida.com/6deadsky9/32/288_2.png) [@6DeadSky9](https://talk.jelurida.com/u/6DeadSky9)\
**Post date:** [17 March 2023 17:58 UTC](https://talk.jelurida.com/t/bridge-parameters-when-deploying/869/5 "2023-03-17T17:58:19Z")

</div>

I forgot to try the number one solution for all IT people... reboot! 😅 🤣

**Now its working, thanks!!!**
