Skip to content

Commit

Permalink
Changed vesting init
Browse files Browse the repository at this point in the history
  • Loading branch information
bra1nsurfer committed Nov 7, 2024
1 parent ad9a3c3 commit 2b31f9d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ride/l2mp_leasing.ride
Original file line number Diff line number Diff line change
Expand Up @@ -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()
]
Expand All @@ -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())
]
}

Expand Down

0 comments on commit 2b31f9d

Please sign in to comment.