Skip to content

Commit

Permalink
fix unlock
Browse files Browse the repository at this point in the history
  • Loading branch information
ridev6 committed Aug 8, 2023
1 parent ba15a1b commit 899e4a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ride/boosting.ride
Original file line number Diff line number Diff line change
Expand Up @@ -737,9 +737,9 @@ func unlock(txIdStr: String, amount: Int) = {
strict gwxRewardInv = gwxRewardContract.reentrantInvoke("refreshUserReward", [userAddress.bytes], [])

LockParamsEntry(userAddress, txId, userAmount, lockStart, lockDuration, gwxRemaining, wxClaimed + amount)
++ StatsEntry(-userAmount, 0, 0, -1) # fixme: -1 only if single lock from user existed
:+ HistoryEntry("unlock", userAddressStr, userAmount, lockStart, lockDuration, gwxBurned, i)
:+ ScriptTransfer(userAddress, userAmount, assetId)
++ StatsEntry(-amount, 0, 0, 0)
:+ HistoryEntry("unlock", userAddressStr, amount, lockStart, lockDuration, gwxBurned, i)
:+ ScriptTransfer(userAddress, amount, assetId)
++ [
IntegerEntry(keyGwxTotal(), ensurePositive(gwxAmountTotal - gwxBurned, "gwxTotal")),
IntegerEntry(keyUserGwxAmountTotal(userAddress), ensurePositive(userGwxAmountTotal - gwxBurned, "userGwxAmountTotal"))
Expand Down

0 comments on commit 899e4a5

Please sign in to comment.