Keep getting error

We have updated our Sway Lend market contract with optimization but after we have deployed it testnet with new contract address all frontend calls stopped working with strange and not much telling error name, but rust test keeps working fine.
github link - Storage of supplied collateral assets by chlenc · Pull Request #16 · sway-gang/sway-lend · GitHub
deployed contract address - fc9f907677b60baeef1a78996ef6abaefb4539b91955e87f23e04977726342c5 fuel1lj0eqanhkc96amc60zvkaa4t4ma52wder927slerupyhwunrgtzsg2lps6
error massage -

Error: Script returned non-zero result: 1

{
  "doc": "https://docs.rs/fuel-asm/latest/fuel_asm/enum.PanicReason.html",
  "reason": "unknown"
}

Reverts:
0xfc9f907677b60baeef1a78996ef6abaefb4539b91955e87f23e04977726342c5: 123 {"type":4,"val":"0x7b","pc":"0x44e0","is":"0x4370"}

Receipts:
[
  {
    "type": "Call",
    "from": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "to": "0xfc9f907677b60baeef1a78996ef6abaefb4539b91955e87f23e04977726342c5",
    "amount": "0x0",
    "assetId": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "gas": "0x5f56199",
    "param1": "0x7e2982d8",
    "param2": "0x3868",
    "pc": "0x4370",
    "is": "0x4370"
  },
  {
    "type": "Revert",
    "id": "0xfc9f907677b60baeef1a78996ef6abaefb4539b91955e87f23e04977726342c5",
    "val": "0x7b",
    "pc": "0x44e0",
    "is": "0x4370"
  },
  {
    "type": "ScriptResult",
    "result": "0x1",
    "gasUsed": "0xb5a4"
  }
]
    at R.decodeCallResult (script.ts:118:1)
    at y.getDecodedValue (invocation-results.ts:46:1)
    at new b (invocation-results.ts:37:1)
    at new y (invocation-results.ts:127:1)
    at y.build (invocation-results.ts:137:1)
    at S.simulate (base-invocation-scope.ts:237:1)
    at async Promise.all (:3000/index 1)
    at async PricesStore.updateTokenPrices (PricesStore.ts:52:1)

Hope to see solutions :grinning: :grinning:

Summary

:grinning:

Interesting, I can try to replicate soon but I am bit busy at the moment. Briefly looking through your code though I couldn’t find the rust test to the supply collateral function? I can’t tell much on your error message, but as I see you are writing a lending protocol some immediate ideas

  1. Not appending inputs correctly when sending a tx which mints coins
  2. Not appending contract inputs correctly when calling a contract which calls other contracts

Both of which the appended assets could also be malformed but utxo_validation being off on the local test node leads to it passing in the test but failing in prod

1 Like