Skip to content

Commit

Permalink
Merge pull request #459 from waves-exchange/l2mp-leasing-patch
Browse files Browse the repository at this point in the history
TotalL2 MaxInt fix
  • Loading branch information
bra1nsurfer authored Nov 7, 2024
2 parents 44f317f + ad9a3c3 commit 7f8beb8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ride/l2mp_leasing.ride
Original file line number Diff line number Diff line change
Expand Up @@ -686,16 +686,17 @@ func stakeFor(userAddress: String) = {
}

@Callable(i)
func startUnitsVesting(unitsClaimNewInterval: Int) = {
let totalL2 = 1_000_000_000_0000_0000
func startUnitsVesting(unitsClaimNewInterval: Int, totalL2String: String) = {
let totalUnits = i.payments[0].amount
let totalL2 = totalL2String.parseIntValue()

let unitsPerBlockScale16 = fraction(totalUnits, 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()
unitsPerBlockScale16 > 0 || "units per block should be greated than 0".throwErr(),
totalL2 > 0 || "total l2 should be greated than 0".throwErr()
]

[
Expand Down

0 comments on commit 7f8beb8

Please sign in to comment.