I updated SwayLend market contract to latest versions and also to beta 4. I have function on frontend that check MaxBorrowAmount from contract state, on previous beta3 I was using this code to be able to get value
There’s something failing on the transaction simulation since “decodeCallResult” is throwing an error.
However, the error wrapper is falling to catch an undefined value in the Transaction result. This might be an issue beyond your specific case. I’ll escalate this.
Meanwhile, I recommend you to set “txParams.gasLimit” as a number rather than an string. I don’t see anything else that might be wrong with your transaction simulation.
Please also make sure that you specified/initialized the storageSlots when you deployed your contract. I was facing a similar issue this morning and it was fixed once I deployed the contract with storageSlots specified
Thanks for the suggestion but in my contract I have everywhere catches that would prevent failing if the variable is not initialized, like below.
let balance = storage.user_collateral.get((account, asset_config.asset_id)).try_read().unwrap_or(0);
Also would like to notify you that the Rust tests are passing successfully for this contract, we just have some problems with typescript SDK due to updates
But it’s really interesting to hear about how to initialize storage slots, probably it will make my contract cleaner, please have a look at new topic here