The transaction reverted with an unknown reason

Title: Issue with Order Creation Transaction in Spark Frontend

Hello everyone,

I’m currently facing an issue while creating an order using our Spark frontend. When I attempt to send the order creation transaction, it fails and throws the error: “The transaction reverted with an unknown reason.”

Despite this error, I notice that the order is actually created successfully. Has anyone encountered a similar issue or have any insights into why this might be happening?

Best regards,

Tx id

2 Likes

Hi @fuel ,

This looks like an error decoding a returned result. Can you please provide the Typescript SDK version you are working with, and the results of fuelup show so we can diagnose things from there?

“fuels”: “^0.89.0”,

Okay, got it.

Can you provide any gist, github project, branch to the exact code causing you this issue?

As well, can you provide the transaction hash and link to the transaction that passed but “failed to decode” on the SDK side?

So the order is created successfully, but your saying that the TS-SDK is throwing an error. Might be the TS SDK decoder @fuel . Let me check with the team.

This may also be related to this issue @fsociety had recently:

Yes, we had a similar issue in the past that got fixed, but it seems not 100%.

Do you have the full error Object? It should contain more properties. (example)

I suspect we may be failing to map out the exact reason for this method.

Any repro you can provide will significantly help address the issue.

Unfortunately, I have already closed the tab, if another problem arises I will post the output

I have same issue nearly with every 10th transaction when I try to create order

3 Likes

Thanks for sharing this @nadiia-balaian , do you have a reproducible branch? If so could you open an issue on the repo and we can debug there?

Having the same issue trying to call a function in my smart-contract, it reverts with

‘The transaction reverted with an unknown reason: 0’

The metadata receipts:

[
{
type: 0,
from: ‘0x0000000000000000000000000000000000000000000000000000000000000000’,
to: ‘0xb1a89eb7c4d757f64442dc41f07fceb40fc50a46226e6b315cb5398dbceb9c1a’,
amount: <BN: 0x0>,
assetId: ‘0x0000000000000000000000000000000000000000000000000000000000000000’,
gas: <BN: 0x197f058>,
param1: <BN: 0x28f0>,
param2: <BN: 0x2901>,
pc: <BN: 0x2db8>,
is: <BN: 0x2db8>
},
{
type: 4,
id: ‘0xb1a89eb7c4d757f64442dc41f07fceb40fc50a46226e6b315cb5398dbceb9c1a’,
val: <BN: 0x0>,
pc: <BN: 0x6740>,
is: <BN: 0x2db8>
},
{ type: 9, result: <BN: 0x1>, gasUsed: <BN: 0x80a7> }
]

Were you able to find a solution or why this error is happening?

I believe we just found the source of the problem:

1 Like