Having trouble deploying a smart contract using contract templateId

Hi, I have uploaded a simple contract template onto my Fireblocks Sandbox, here is the implementation of its:
// SPDX-License-Identifier: MIT
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity ^0.8.22;

contract HelloWorld {
constructor()
{}

function sayHello() public pure returns (string memory) {
    return "Hello, World!";
}

}

and this is the function in JavaScript which I use to deploy the contract:
async function deployContract() {
const assetId = “AMOY_POLYGON_TEST”;
const vaultAccountId = “1”;
const constructorParameters = ;
const contractTemplateId = “e06b9427-bb9c-4c59-b4a3-131550f7273a”;

try {
const result = await fireblocks.contractTemplates.deployContract({
contractDeployRequest: {
assetId: assetId,
vaultAccountId: vaultAccountId,
constructorParameters: constructorParameters,
},
contractTemplateId: contractTemplateId,
});
console.log(result);
} catch (e) {
if (e.response && e.response.data && e.response.data.errorMessage) {
console.log(“Detailed error:”, e.response.data.errorMessage);
}
console.error(e);
}
}

So after I have successfully submitted the deployment request onto Fireblocks, I got this error said:

subStatus: ‘SMART_CONTRACT_EXECUTION_FAILED’,
errorDescription: ‘execution reverted’

I don’t know why this is arising since the contract doesn’t require any constructor parameters which may lead to the ‘execution reverted’ problem, and the vault is funded with an adequate amount of token . Can somebody help me?

Hi @pal – this deployment failed due to internal errors when estimating the gas limit for the deployment, apologies for the inconvenience! I see you were later able to deploy a contract on Amoy Polygon.

Let us know if you still have any issues!

Hi @yoji, yes, I was able to deploy a contract on Amoy Polygon, but only in the case where I remove the constructor function from the contract. If I add it back, the contract becomes undeployable again. How can I fix this issue, or do you have any idea what might be causing the problem so I can debug it more effectively?

Hi @yoji, I also wanna ask about the case when I want to deploy a smart contract that link with a library. How can I link the address of the lib with my smart contract when deploying using Fireblocks?

I see, thanks for the clarification. Let me run some tests and check internally on (1) why having a constructor is causing gas estimation issues when deploying, and (2) best practices on linking external libraries. Is including the library code in the source code an option for you? And are there any other requirements (e.g. updateable address, etc.)?