diff --git a/ride/l2mp_leasing.ride b/ride/l2mp_leasing.ride index 38398cef..08fb0582 100644 --- a/ride/l2mp_leasing.ride +++ b/ride/l2mp_leasing.ride @@ -686,15 +686,15 @@ func stakeFor(userAddress: String) = { } @Callable(i) -func startUnitsVesting(unitsClaimNewInterval: Int, totalL2String: String) = { - let totalUnits = i.payments[0].amount +func startUnitsVesting(unitsClaimNewInterval: Int, totalL2String: String, unitsAssetIdstring: String, unitsAmountString: String) = { + let unitsAmount = unitsAmountString.parseIntValue() let totalL2 = totalL2String.parseIntValue() + let unitsAsset = unitsAssetIdstring.assetStringToBytes() - let unitsPerBlockScale16 = fraction(totalUnits, scale16, totalL2) / unitsClaimNewInterval + let unitsPerBlockScale16 = fraction(unitsAmount, scale16, totalL2) / unitsClaimNewInterval strict check = [ isInAdminList(i.caller.toString()) || "caller is not in adminList".throwErr(), - i.payments.size() == 1 || "should be 1 payment".throwErr(), unitsPerBlockScale16 > 0 || "units per block should be greated than 0".throwErr(), totalL2 > 0 || "total l2 should be greated than 0".throwErr() ] @@ -703,7 +703,7 @@ func startUnitsVesting(unitsClaimNewInterval: Int, totalL2String: String) = { IntegerEntry(keyUnitsPerBlockScale16, unitsPerBlockScale16), IntegerEntry(keyUnitsClaimStartHeight, height), IntegerEntry(keyUnitsClaimInterval, unitsClaimNewInterval), - StringEntry(keyUnitsAssetId, i.payments[0].assetId.assetBytesToString()) + StringEntry(keyUnitsAssetId, unitsAsset.assetBytesToString()) ] }