You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, I am transitioning to remove the pyth call from within the contract and instead handle the price update in pyth and order opening in a Sway script. The new script setup is as follows:
The text was updated successfully, but these errors were encountered:
digorithm
changed the title
ailed to decode log from require revert: Invalid data: missing log formatter
Failed to decode log from require revert: Invalid data: missing log formatter
May 2, 2024
Can you please try to use with_contracts as you did before. You can do the same with script calls. Something like this:
script_alice_instance
.main(
btc.asset_id,
I64::new(btc.parse_units(0.5) as u64, false), //Long position
btc_price,
update_data,
fee,
)
.with_contracts(&[ // all of these should be `contract_instances`
&spark.proxy,
&spark.perp_market,
&spark.pyth,
&spark.account_balance,
&spark.vault,
&spark.clearing_house,
])
.call()
.await
.unwrap();
Some context:
There is no way to decode logs if you provide only contract_ids as we do not know the mappings between log IDs and types.
Problem Description
Previously, I implemented an order creation as shown below, where
pyth
was called inside the contract:Now, I am transitioning to remove the
pyth
call from within the contract and instead handle the price update inpyth
and order opening in a Sway script. The new script setup is as follows:The new order creation now looks like this:
However, this call fails with the following error:
Environment
SDK version:
fuels = { version = "0.55.1", features = ["fuel-core-lib"] }
repo:
https://github.com/compolabs/spark-perps
branch: "create-order-script"
toolchain:
The text was updated successfully, but these errors were encountered: