CreateTransaction Failed UNKNOWN_ERROR

Hi,

I’m trying to deploy a simple the Simple Counter smart contract and call its functions.

After creating a Vault and Uploading the Contract Template successfully I call the contract template deploy endpoint which gives me a transaction ID.

I use that ID to send a CONTRACT_CALL request at /v1/transactions.

I get status “SUBMITTED” but I if I look at the transaction history I can see the that it has failed.

	"status": "FAILED",
	"txHash": "",
	"subStatus": "UNKNOWN_ERROR",

is there a way to have more details on what exactly has went wrong?

Thanks
Dinob

Hey @dinob,

Can you please share the failed transaction ID so we’ll be able to take a closer look?

Thanks Slava,

Id is 3b0deced-733b-456b-a02b-4e07010f7f9e

Hi @dinob
when sending a string, it must be a hex string. We got: ‘30fb48c8-0996-46e9-8b11-d578e8119f93’ in the One Time Address in the payload. (type=value_error)

Please make sure the payload is correct and try it again

Hey @BetsalelKog

Thanks for your response, we’ve adjusted the payload and can confirm that we get a successful response back from Fireblocks. The below is a response from the /v1/transactions endpoint.

{
  "id": "03cfd4b4-3955-41b4-b768-53e9776b7772",
  "status": "SUBMITTED",
  "systemMessages": null
}

Unfortunately, this is where we start to face problems again. Once the above is complete, we carry out a GET call to the /v1/transactions. In the GET call we can see that we’ve got an error.

The first time, the status was


"status": "FAILED",
"txHash": "",
"subStatus": "INSUFFICIENT_FUNDS_FOR_FEE",

The second time, the status is returned as the below.


"status": "FAILED",
"txHash": "",
"subStatus": "UNKNOWN_ERROR",

At this point we’re unsure why this is occurring and what the steps are to resolve these errors. I am unsure on how we’re to interact with our demo counter smart contract. Any help would be appreciated. Thanks!

Hi @msantilal
Again I can see you send to this One Time address 24abd0db-0c03-47a9-b114-f5640dcffc5e
Can you please share the payload you send?

Hey @BetsalelKog,

This is the payload we are sending

{
  "operation" : "CONTRACT_CALL",
  "note" : "My First CreateTransaction",
  "externalTxId" : "856bdc45-9fc7-4d59-8585-9b1beb12ce46",
  "assetId" : "ETH_TEST5",
  "source" : {
    "type" : "VAULT_ACCOUNT",
    "id" : "32"
  },
  "destination" : {
    "type" : "ONE_TIME_ADDRESS",
    "oneTimeAddress" : {
      "address" : "24abd0db-0c03-47a9-b114-f5640dcffc5e"
    }
  },
  "amount" : "0.001",
  "treatAsGrossAmount" : false,
  "forceSweep" : false,
  "failOnLowFee" : false,
  "extraParameters" : {
    "contractCallData" : "0x3fb5c1cb0000000000000000000000000000000000000000000000000000000000000001"
  },
  "autoStaking" : false,
  "useGasless" : false
}

We provide the following headers along with the request

@msantilal The address you put is not a valid one.
I can see this CONTRACTCALL data is to advance the nonce for this address right?
0x9E6890662b51914ee5CDd66852132828D93779ca

If yes please enter this address here
“destination” : {
“type” : “ONE_TIME_ADDRESS”,
“oneTimeAddress” : {
“address” : “0x9E6890662b51914ee5CDd66852132828D93779ca”
}
},

I can certainly try that and let you know in a few minutes.

Out of curiosity, in the oneTimeAddress field, we’re passing through the ID of the deployedContract which is returned to us as 24abd0db-0c03-47a9-b114-f5640dcffc5e. Where is the 0x9E6890662b51914ee5CDd66852132828D93779ca address retrieved from?

Gave the provided one time address a try, still getting.

"status": "FAILED",
"txHash": "",
"subStatus": "UNKNOWN_ERROR",

This 0x9E6890662b51914ee5CDd66852132828D93779ca is the source address of the vault.
you can see it in the vault in the console.

Please set the address with 0x
use 0x9E6890662b51914ee5CDd66852132828D93779ca

Have tried with 0x. Still no change.

Could you provide an example payload on what the system is expecting?

Because you have 0 balance in the vault.

Use a fauct to get some ETH_TEST5 and then try the payload with the 0x

Ok gotcha, so I use a faucet and request ETH on the 0x9E6890662b51914ee5CDd66852132828D93779ca account?

Hi @msantilal , I’d like to pick it up from this comment of yours:

For this field, you need to pass the contractAddress (not ID) of your deployment, but it seems you don’t have a valid deployment yet. Please retry this deployment by referring to the pointers below:

  • The /v1/tokenization/templates endpoint mentioned in one of your other posts will let you create a contract template to later reuse for deployments. I’m assuming you have successfully created the template, as per your initial post. I’m also assuming that now you are trying to deploy a contract instance of such template, to further perform a contract call.
  • To deploy your template, for which you should have the template ID, please use the /v1/tokenization/tokens endpoint that is described in the OpenAPI spec (search for Fireblocks docs api swagger issueNewToken). This is the recommended endpoint to deploy contracts based on templates.
  • NOTE: If you are using auto-fueling please revisit Set Auto Fueling Property as your vault account still needs to have a gas token balance before the transaction is initiated.
  • Your CONTRACT_CALL transaction seems mostly correct. The one time address to use, should actually be the address of your deployed contract.
  • To find the address of your deployed contract, inspect the response of the “Issue New Token” request from above. If should have a metadata field with the contract address. Please see this sample return object from one of the SDKs, which documents return types and properties: ts-sdk/docs/models/TokenLinkDto.md at master · fireblocks/ts-sdk · GitHub

Happy to continue helping if you have questions on any of the above.