Skip to content

Commit

Permalink
fix addSyntheticAsset
Browse files Browse the repository at this point in the history
  • Loading branch information
ridev6 committed May 16, 2024
1 parent 93e01ea commit 66fc54c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ride/futures_calculator.ride
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,8 @@ func setPairAllowance(callerPublicKey: ByteVector, args: List[String]) = {
# args: [assetId]
@Callable(i)
func addSyntheticAsset(callerPublicKey: ByteVector, args: List[String]) = {
let baseAssetIdStr = args[0]
let baseAssetId = parseAssetId(baseAssetIdStr)
let syntheticAssetId = i.payments[0].assetId
let baseAssetId = parseAssetId(args[0])
let syntheticAssetId = parseAssetId(args[1])

strict ckecks = [
!shutdown || throwErr("not allowed"),
Expand All @@ -580,9 +579,6 @@ func addSyntheticAsset(callerPublicKey: ByteVector, args: List[String]) = {
factoryAddress.getString(kSyntheticAssetId(baseAssetId)) == unit || throwErr(
"invalid base asset"
),
i.payments.size() == 1 || throwErr(
"invalid payments"
),
factoryAddress.getString(kBaseAssetId(syntheticAssetId)) == unit || throwErr(
"invalid synthetic asset"
)
Expand Down

0 comments on commit 66fc54c

Please sign in to comment.