tx · 9qjQ7prN1uN8zFBAFA3cmehN8bies5ynw7cTvFZpSYzj

3NA3yH1QryPynpwGhEYR3W3LSneJK73rWeL:  -0.00900000 Waves

2022.08.10 19:56 [2178604] smart account 3NA3yH1QryPynpwGhEYR3W3LSneJK73rWeL > SELF 0.00000000 Waves

{ "type": 13, "id": "9qjQ7prN1uN8zFBAFA3cmehN8bies5ynw7cTvFZpSYzj", "fee": 900000, "feeAssetId": null, "timestamp": 1660150635638, "version": 2, "chainId": 84, "sender": "3NA3yH1QryPynpwGhEYR3W3LSneJK73rWeL", "senderPublicKey": "6Ji8AyKFQegAeGHgCr6CYZgm3xxVSbQ9A884zpfzxS77", "proofs": [ "4aE6CaptPfDo9ecL7CGmJXREQKNREj88VRv4jLRJVhpwReBAZGfJQjdZeUpkbQAssE4427D8MdtRc4FF8L6m3x4v" ], "script": "base64:AAIFAAAAAAAAAB8IAhIDCgEIEgMKAQgSBAoCCAESBQoDCAgBEgQKAggYAAAAFwAAAAAUc3Rha2VBbW91bnRUaHJlc2hvbGQAAAAAAAAAAAEAAAAAEWxvY2tQZXJpb2RzSW5EYXlzCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAACgkABEwAAAACAAAAAAAAAAAeCQAETAAAAAIAAAAAAAAAAFoFAAAAA25pbAAAAAAYcG9zc2libGVUb2tlbnNGb3JSZXdhcmRzCQAETAAAAAICAAAABlJFRFNtYgkABEwAAAACAgAAAANCVEMFAAAAA25pbAAAAAAHaG91cnMyNAAAAAAABSZcAAAAAAAKYXByOG9mMjAyMgAAAAGABnh4AAAAAAAQY3VycmVudFRpbWVzdGFtcAgFAAAACWxhc3RCbG9jawAAAAl0aW1lc3RhbXAAAAAAE2tleV9IYXNocmF0ZVRva2VuSWQCAAAAD2hhc2hyYXRlVG9rZW5JZAAAAAAPa2V5X1N0YWtlZFRvdGFsAgAAAAxzdGFrZWRfdG90YWwBAAAAD2tleV9Vc2VyU3Rha2luZwAAAAIAAAAHYWRkcmVz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A==", "height": 2178604, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6DaPD16Yqps9GjwdXMDWTy14yvGCJztqcJJ1qbG8WrFb Next: none Diff:
OldNewDifferences
2020 func key_UserStaking (address,txId) = ((address + "_staking_") + txId)
2121
2222
23-func key_UserStakedTotal (address) = (address + "_total")
23+func key_UserStakedTotal (address) = (address + "_lockedTotal")
2424
2525
2626 let key_LastStakeTxId = "last_stake_tx_id"
6363 let beginningOfNexDayTimestamp = ((currentTimestamp + hours24) - (currentTimestamp % hours24))
6464 let lockUntilTimestamp = (beginningOfNexDayTimestamp + (daysToLock * hours24))
6565 let stakingKey = key_UserStaking(callerStr, toBase58String(inv.transactionId))
66- let stakingValue = makeString([ACTIVE, toString(pmtAmount), rewardType, toString(daysToLock), toString(currentTimestamp), toString(lockUntilTimestamp)], ",")
66+ let stakingValue = makeString([ACTIVE, toString(pmtAmount), rewardType, toString(daysToLock), toString(currentTimestamp), toString(lockUntilTimestamp), toString(beneficiary)], ",")
6767 if ((inv.transactionId == lastStakeTxId))
6868 then throw("There is only one staking per transaction allowed for now")
6969 else if (isDefined(getString(this, stakingKey)))
8585 then throw("Only the DApp itself can call this function")
8686 else if (isDAppInit)
8787 then throw("DApp is already init")
88- else [StringEntry(key_HashrateTokenId, toBase58String(newAssetId)), IntegerEntry(key_StakedTotal, 0)]
88+ else [StringEntry(key_HashrateTokenId, toBase58String(newAssetId)), IntegerEntry(key_StakedTotal, 0), StringEntry(key_LastStakeTxId, toBase58String(inv.transactionId))]
8989 }
9090
9191
103103
104104
105105 @Callable(inv)
106-func lockBy (beneficiary,rewardType,daysToLock) = stake(inv, rewardType, daysToLock, valueOrErrorMessage(addressFromString(beneficiary), (("Can't parse benefeciary '" + beneficiary) + "' as address")))
106+func lockBy (beneficiary,rewardType,daysToLock) = if ((inv.caller != promoDApp))
107+ then throw("")
108+ else stake(inv, rewardType, daysToLock, valueOrErrorMessage(addressFromString(beneficiary), (("Can't parse benefeciary '" + beneficiary) + "' as address")))
107109
108110
109111
119121 then throw((("staking '" + txId) + "' is already unlocked"))
120122 else val
121123 }
122- let $t058375925 = $Tuple2(parseIntValue(parameters[1]), parseIntValue(parameters[5]))
123- let amount = $t058375925._1
124- let lockUntil = $t058375925._2
124+ let $t059746062 = $Tuple2(parseIntValue(parameters[1]), parseIntValue(parameters[5]))
125+ let amount = $t059746062._1
126+ let lockUntil = $t059746062._2
125127 if ((lockUntil > currentTimestamp))
126128 then throw(((("Unable to withdraw staking " + txId) + " because it is still locked until ") + toString(lockUntil)))
127129 else $Tuple2((acc._1 :+ StringEntry(((user + "_") + txId), makeString([FINISHED, parameters[1], parameters[2], parameters[3], parameters[4], parameters[5]], ","))), (acc._2 + amount))
128130 }
129131
130- let $t063176395 = {
132+ let $t064546532 = {
131133 let $l = staking
132134 let $s = size($l)
133135 let $acc0 = $Tuple2(nil, 0)
141143
142144 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
143145 }
144- let unstakeList = $t063176395._1
145- let totalUnstaked = $t063176395._2
146+ let unstakeList = $t064546532._1
147+ let totalUnstaked = $t064546532._2
146148 let userTotalKey = key_UserStakedTotal(user)
147149 let userTotal = valueOrElse(getInteger(this, userTotalKey), 0)
148150 let userTotalAfter = (userTotal - totalUnstaked)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let stakeAmountThreshold = 1
55
66 let lockPeriodsInDays = [1, 10, 30, 90]
77
88 let possibleTokensForRewards = ["REDSmb", "BTC"]
99
1010 let hours24 = 86400000
1111
1212 let apr8of2022 = 1649376000000
1313
1414 let currentTimestamp = lastBlock.timestamp
1515
1616 let key_HashrateTokenId = "hashrateTokenId"
1717
1818 let key_StakedTotal = "staked_total"
1919
2020 func key_UserStaking (address,txId) = ((address + "_staking_") + txId)
2121
2222
23-func key_UserStakedTotal (address) = (address + "_total")
23+func key_UserStakedTotal (address) = (address + "_lockedTotal")
2424
2525
2626 let key_LastStakeTxId = "last_stake_tx_id"
2727
2828 let key_PromoDApp = "promo_dapp"
2929
3030 let key_Issuer_AssetId = "assetId"
3131
3232 let isDAppInit = if (!(isDataStorageUntouched(this)))
3333 then true
3434 else isDefined(getString(this, key_HashrateTokenId))
3535
3636 let hashrateTokenId = fromBase58String(getStringValue(this, key_HashrateTokenId))
3737
3838 let stakedTotal = valueOrErrorMessage(getInteger(this, key_StakedTotal), (("Can't read field '" + key_StakedTotal) + "'"))
3939
4040 let lastStakeTxId = fromBase58String(valueOrErrorMessage(getString(this, key_LastStakeTxId), (("Can't read field '" + key_LastStakeTxId) + "'")))
4141
4242 let promoDApp = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, key_PromoDApp), (("Can't read field '" + key_PromoDApp) + "'"))), "Can't parse promo DApp address")
4343
4444 let ACTIVE = "1"
4545
4646 let FINISHED = "0"
4747
4848 func extractPaymentAmount (payments) = if ((size(payments) != 1))
4949 then throw("Single payment required")
5050 else if ((payments[0].assetId != hashrateTokenId))
5151 then throw("Only REDSmb token is accepted")
5252 else if ((stakeAmountThreshold > payments[0].amount))
5353 then throw(("Payment amount must be greater then threshold " + toString(stakeAmountThreshold)))
5454 else payments[0].amount
5555
5656
5757 func getCurrentLockedAmount (user) = valueOrElse(getInteger(this, key_UserStakedTotal(user)), 0)
5858
5959
6060 func stake (inv,rewardType,daysToLock,beneficiary) = {
6161 let callerStr = toString(inv.caller)
6262 let pmtAmount = extractPaymentAmount(inv.payments)
6363 let beginningOfNexDayTimestamp = ((currentTimestamp + hours24) - (currentTimestamp % hours24))
6464 let lockUntilTimestamp = (beginningOfNexDayTimestamp + (daysToLock * hours24))
6565 let stakingKey = key_UserStaking(callerStr, toBase58String(inv.transactionId))
66- let stakingValue = makeString([ACTIVE, toString(pmtAmount), rewardType, toString(daysToLock), toString(currentTimestamp), toString(lockUntilTimestamp)], ",")
66+ let stakingValue = makeString([ACTIVE, toString(pmtAmount), rewardType, toString(daysToLock), toString(currentTimestamp), toString(lockUntilTimestamp), toString(beneficiary)], ",")
6767 if ((inv.transactionId == lastStakeTxId))
6868 then throw("There is only one staking per transaction allowed for now")
6969 else if (isDefined(getString(this, stakingKey)))
7070 then throw((("Staking '" + stakingKey) + "' already exists"))
7171 else if (!(containsElement(possibleTokensForRewards, rewardType)))
7272 then throw((("Unsupported reward type '" + rewardType) + "'"))
7373 else if (!(containsElement(lockPeriodsInDays, daysToLock)))
7474 then throw((("Unsupported number of days " + toString(daysToLock)) + " to mine"))
7575 else [StringEntry(stakingKey, stakingValue), IntegerEntry(key_UserStakedTotal(toString(inv.caller)), (getCurrentLockedAmount(toString(inv.caller)) + pmtAmount)), IntegerEntry(key_StakedTotal, (stakedTotal + pmtAmount)), StringEntry(key_LastStakeTxId, toBase58String(inv.transactionId))]
7676 }
7777
7878
7979 @Callable(inv)
8080 func init (hashrateTokenIssuer) = {
8181 let issuer = valueOrErrorMessage(addressFromString(hashrateTokenIssuer), (("Can't parse issuer address '" + hashrateTokenIssuer) + "'"))
8282 let assetIdStr = valueOrErrorMessage(getString(issuer, key_Issuer_AssetId), ((("Can't find entry '" + key_Issuer_AssetId) + "' at address ") + hashrateTokenIssuer))
8383 let newAssetId = valueOrErrorMessage(assetInfo(fromBase58String(assetIdStr)), (("Can't find asset '" + assetIdStr) + "'")).id
8484 if ((inv.caller != this))
8585 then throw("Only the DApp itself can call this function")
8686 else if (isDAppInit)
8787 then throw("DApp is already init")
88- else [StringEntry(key_HashrateTokenId, toBase58String(newAssetId)), IntegerEntry(key_StakedTotal, 0)]
88+ else [StringEntry(key_HashrateTokenId, toBase58String(newAssetId)), IntegerEntry(key_StakedTotal, 0), StringEntry(key_LastStakeTxId, toBase58String(inv.transactionId))]
8989 }
9090
9191
9292
9393 @Callable(inv)
9494 func setPromoDApp (address) = if (isDefined(getString(this, key_PromoDApp)))
9595 then throw("Promo DApp address is already specified")
9696 else [StringEntry(key_PromoDApp, toString(valueOrErrorMessage(addressFromString(address), (("Can't parse '" + address) + "' as address"))))]
9797
9898
9999
100100 @Callable(inv)
101101 func lock (rewardType,daysToLock) = stake(inv, rewardType, daysToLock, inv.caller)
102102
103103
104104
105105 @Callable(inv)
106-func lockBy (beneficiary,rewardType,daysToLock) = stake(inv, rewardType, daysToLock, valueOrErrorMessage(addressFromString(beneficiary), (("Can't parse benefeciary '" + beneficiary) + "' as address")))
106+func lockBy (beneficiary,rewardType,daysToLock) = if ((inv.caller != promoDApp))
107+ then throw("")
108+ else stake(inv, rewardType, daysToLock, valueOrErrorMessage(addressFromString(beneficiary), (("Can't parse benefeciary '" + beneficiary) + "' as address")))
107109
108110
109111
110112 @Callable(inv)
111113 func unlock (user,staking) = {
112114 let userAddress = valueOrErrorMessage(addressFromString(user), (("Can't parse user address '" + user) + "'"))
113115 func extractStaking (acc,txId) = {
114116 let parameters = {
115117 let val = split(valueOrErrorMessage(getString(this, key_UserStaking(user, txId)), ((("Staking " + txId) + " doesn't exist for user ") + user)), ",")
116118 if ((size(val) != 6))
117119 then throw(("Can't parse parameters of staking " + txId))
118120 else if ((val[0] != ACTIVE))
119121 then throw((("staking '" + txId) + "' is already unlocked"))
120122 else val
121123 }
122- let $t058375925 = $Tuple2(parseIntValue(parameters[1]), parseIntValue(parameters[5]))
123- let amount = $t058375925._1
124- let lockUntil = $t058375925._2
124+ let $t059746062 = $Tuple2(parseIntValue(parameters[1]), parseIntValue(parameters[5]))
125+ let amount = $t059746062._1
126+ let lockUntil = $t059746062._2
125127 if ((lockUntil > currentTimestamp))
126128 then throw(((("Unable to withdraw staking " + txId) + " because it is still locked until ") + toString(lockUntil)))
127129 else $Tuple2((acc._1 :+ StringEntry(((user + "_") + txId), makeString([FINISHED, parameters[1], parameters[2], parameters[3], parameters[4], parameters[5]], ","))), (acc._2 + amount))
128130 }
129131
130- let $t063176395 = {
132+ let $t064546532 = {
131133 let $l = staking
132134 let $s = size($l)
133135 let $acc0 = $Tuple2(nil, 0)
134136 func $f0_1 ($a,$i) = if (($i >= $s))
135137 then $a
136138 else extractStaking($a, $l[$i])
137139
138140 func $f0_2 ($a,$i) = if (($i >= $s))
139141 then $a
140142 else throw("List size exceeds 10")
141143
142144 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
143145 }
144- let unstakeList = $t063176395._1
145- let totalUnstaked = $t063176395._2
146+ let unstakeList = $t064546532._1
147+ let totalUnstaked = $t064546532._2
146148 let userTotalKey = key_UserStakedTotal(user)
147149 let userTotal = valueOrElse(getInteger(this, userTotalKey), 0)
148150 let userTotalAfter = (userTotal - totalUnstaked)
149151 if ((size(inv.payments) != 0))
150152 then throw("There should be no payments for this function")
151153 else if (if ((inv.caller != this))
152154 then (userAddress != inv.caller)
153155 else false)
154156 then throw("Only users themselves can withdraw their unlocked staking, or admin for them")
155157 else if ((userAddress == promoDApp))
156158 then throw("Promo staking can be unlocked only by Promo DApp only")
157159 else if (if (if ((0 > userTotal))
158160 then true
159161 else (0 > totalUnstaked))
160162 then true
161163 else (0 > userTotalAfter))
162164 then throw("negative result")
163165 else (unstakeList ++ [IntegerEntry(key_StakedTotal, (stakedTotal - totalUnstaked)), if ((userTotalAfter > 0))
164166 then IntegerEntry(userTotalKey, userTotalAfter)
165167 else DeleteEntry(userTotalKey), ScriptTransfer(userAddress, totalUnstaked, hashrateTokenId)])
166168 }
167169
168170

github/deemru/w8io/169f3d6 
63.82 ms