Skip to content

Commit

Permalink
setEmissionPeriodInBlocks
Browse files Browse the repository at this point in the history
  • Loading branch information
ridev6 committed Jul 28, 2023
1 parent 3410855 commit 74cb7ad
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions ride/l2mp_staking.ride
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ func getWithdrawActions(i: Invocation, lpAssetWithdrawAmount: Int) = {
formatHistory(
calcTotalProfit(),
getCurrentPrice(),
totalAssetAmount,
totalLpAmount
totalLpAmount,
totalAssetAmount
)
),
IntegerEntry(keyTotalLpAmount, newTotalLpAmount),
Expand All @@ -268,6 +268,20 @@ func setEmissionPerBlock(emissionPerBlock: Int) = {
]
}

@Callable(i)
func setEmissionPeriodInBlocks(p: Int) = {
strict check = [
p > 0 || "emission period should be greater than 0".throwErr(),
i.caller == this || "permission denied".throwErr()
]

[
IntegerEntry(keyTotalAssetAmount, getTotalAssetAmountWithProfitOrMaxAvailable()),
IntegerEntry(keyStartBlock, height),
IntegerEntry(keyEmissionPeriodInBlocks, p)
]
}

@Callable(i)
func stake() = {
getStakeActions(i, i.caller.toString())
Expand Down

0 comments on commit 74cb7ad

Please sign in to comment.