Skip to content

Commit

Permalink
fix getWxWithdrawable
Browse files Browse the repository at this point in the history
  • Loading branch information
ridev6 committed Aug 30, 2023
1 parent 9dcf83d commit c06125a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ride/boosting.ride
Original file line number Diff line number Diff line change
Expand Up @@ -624,15 +624,16 @@ func getWxWithdrawable(userAddress: Address, txIdOption: ByteVector|Unit) = {
{ DECAY_CONSTANT * blocksInPeriod }.toBigInt() * MULT18BI,
lockDuration.toBigInt()
)
let wxWithdrawable = if (height > lockEnd) then {
let wxWithdrawableTotal = if (height > lockEnd) then {
userAmount
} else {
fraction(
userAmount.toBigInt(),
MULT18BI - pow(5.toBigInt(), 1, exponent, SCALE18, SCALE18, DOWN),
MULT18BI
).toInt()
} - wxClaimed
}
let wxWithdrawable = wxWithdrawableTotal - wxClaimed

wxWithdrawable
}
Expand Down

0 comments on commit c06125a

Please sign in to comment.