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:AAIFAAAAAAAAAB8IAhIDCgEIEgMKAQgSBAoCCAESBQoDCAgBEgQKAggYAAAAFwAAAAAUc3Rha2VBbW91bnRUaHJlc2hvbGQAAAAAAAAAAAEAAAAAEWxvY2tQZXJpb2RzSW5EYXlzCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgAAAAAAAAAACgkABEwAAAACAAAAAAAAAAAeCQAETAAAAAIAAAAAAAAAAFoFAAAAA25pbAAAAAAYcG9zc2libGVUb2tlbnNGb3JSZXdhcmRzCQAETAAAAAICAAAABlJFRFNtYgkABEwAAAACAgAAAANCVEMFAAAAA25pbAAAAAAHaG91cnMyNAAAAAAABSZcAAAAAAAKYXByOG9mMjAyMgAAAAGABnh4AAAAAAAQY3VycmVudFRpbWVzdGFtcAgFAAAACWxhc3RCbG9jawAAAAl0aW1lc3RhbXAAAAAAE2tleV9IYXNocmF0ZVRva2VuSWQCAAAAD2hhc2hyYXRlVG9rZW5JZAAAAAAPa2V5X1N0YWtlZFRvdGFsAgAAAAxzdGFrZWRfdG90YWwBAAAAD2tleV9Vc2VyU3Rha2luZwAAAAIAAAAHYWRkcmVzc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==", "height": 2178604, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6DaPD16Yqps9GjwdXMDWTy14yvGCJztqcJJ1qbG8WrFb Next: none Diff:
Old | New | Differences | |
---|---|---|---|
20 | 20 | func key_UserStaking (address,txId) = ((address + "_staking_") + txId) | |
21 | 21 | ||
22 | 22 | ||
23 | - | func key_UserStakedTotal (address) = (address + "_ | |
23 | + | func key_UserStakedTotal (address) = (address + "_lockedTotal") | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | let key_LastStakeTxId = "last_stake_tx_id" | |
63 | 63 | let beginningOfNexDayTimestamp = ((currentTimestamp + hours24) - (currentTimestamp % hours24)) | |
64 | 64 | let lockUntilTimestamp = (beginningOfNexDayTimestamp + (daysToLock * hours24)) | |
65 | 65 | 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)], ",") | |
67 | 67 | if ((inv.transactionId == lastStakeTxId)) | |
68 | 68 | then throw("There is only one staking per transaction allowed for now") | |
69 | 69 | else if (isDefined(getString(this, stakingKey))) | |
85 | 85 | then throw("Only the DApp itself can call this function") | |
86 | 86 | else if (isDAppInit) | |
87 | 87 | 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))] | |
89 | 89 | } | |
90 | 90 | ||
91 | 91 | ||
103 | 103 | ||
104 | 104 | ||
105 | 105 | @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"))) | |
107 | 109 | ||
108 | 110 | ||
109 | 111 | ||
119 | 121 | then throw((("staking '" + txId) + "' is already unlocked")) | |
120 | 122 | else val | |
121 | 123 | } | |
122 | - | let $ | |
123 | - | let amount = $ | |
124 | - | let lockUntil = $ | |
124 | + | let $t059746062 = $Tuple2(parseIntValue(parameters[1]), parseIntValue(parameters[5])) | |
125 | + | let amount = $t059746062._1 | |
126 | + | let lockUntil = $t059746062._2 | |
125 | 127 | if ((lockUntil > currentTimestamp)) | |
126 | 128 | then throw(((("Unable to withdraw staking " + txId) + " because it is still locked until ") + toString(lockUntil))) | |
127 | 129 | else $Tuple2((acc._1 :+ StringEntry(((user + "_") + txId), makeString([FINISHED, parameters[1], parameters[2], parameters[3], parameters[4], parameters[5]], ","))), (acc._2 + amount)) | |
128 | 130 | } | |
129 | 131 | ||
130 | - | let $ | |
132 | + | let $t064546532 = { | |
131 | 133 | let $l = staking | |
132 | 134 | let $s = size($l) | |
133 | 135 | let $acc0 = $Tuple2(nil, 0) | |
141 | 143 | ||
142 | 144 | $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) | |
143 | 145 | } | |
144 | - | let unstakeList = $ | |
145 | - | let totalUnstaked = $ | |
146 | + | let unstakeList = $t064546532._1 | |
147 | + | let totalUnstaked = $t064546532._2 | |
146 | 148 | let userTotalKey = key_UserStakedTotal(user) | |
147 | 149 | let userTotal = valueOrElse(getInteger(this, userTotalKey), 0) | |
148 | 150 | let userTotalAfter = (userTotal - totalUnstaked) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let stakeAmountThreshold = 1 | |
5 | 5 | ||
6 | 6 | let lockPeriodsInDays = [1, 10, 30, 90] | |
7 | 7 | ||
8 | 8 | let possibleTokensForRewards = ["REDSmb", "BTC"] | |
9 | 9 | ||
10 | 10 | let hours24 = 86400000 | |
11 | 11 | ||
12 | 12 | let apr8of2022 = 1649376000000 | |
13 | 13 | ||
14 | 14 | let currentTimestamp = lastBlock.timestamp | |
15 | 15 | ||
16 | 16 | let key_HashrateTokenId = "hashrateTokenId" | |
17 | 17 | ||
18 | 18 | let key_StakedTotal = "staked_total" | |
19 | 19 | ||
20 | 20 | func key_UserStaking (address,txId) = ((address + "_staking_") + txId) | |
21 | 21 | ||
22 | 22 | ||
23 | - | func key_UserStakedTotal (address) = (address + "_ | |
23 | + | func key_UserStakedTotal (address) = (address + "_lockedTotal") | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | let key_LastStakeTxId = "last_stake_tx_id" | |
27 | 27 | ||
28 | 28 | let key_PromoDApp = "promo_dapp" | |
29 | 29 | ||
30 | 30 | let key_Issuer_AssetId = "assetId" | |
31 | 31 | ||
32 | 32 | let isDAppInit = if (!(isDataStorageUntouched(this))) | |
33 | 33 | then true | |
34 | 34 | else isDefined(getString(this, key_HashrateTokenId)) | |
35 | 35 | ||
36 | 36 | let hashrateTokenId = fromBase58String(getStringValue(this, key_HashrateTokenId)) | |
37 | 37 | ||
38 | 38 | let stakedTotal = valueOrErrorMessage(getInteger(this, key_StakedTotal), (("Can't read field '" + key_StakedTotal) + "'")) | |
39 | 39 | ||
40 | 40 | let lastStakeTxId = fromBase58String(valueOrErrorMessage(getString(this, key_LastStakeTxId), (("Can't read field '" + key_LastStakeTxId) + "'"))) | |
41 | 41 | ||
42 | 42 | let promoDApp = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, key_PromoDApp), (("Can't read field '" + key_PromoDApp) + "'"))), "Can't parse promo DApp address") | |
43 | 43 | ||
44 | 44 | let ACTIVE = "1" | |
45 | 45 | ||
46 | 46 | let FINISHED = "0" | |
47 | 47 | ||
48 | 48 | func extractPaymentAmount (payments) = if ((size(payments) != 1)) | |
49 | 49 | then throw("Single payment required") | |
50 | 50 | else if ((payments[0].assetId != hashrateTokenId)) | |
51 | 51 | then throw("Only REDSmb token is accepted") | |
52 | 52 | else if ((stakeAmountThreshold > payments[0].amount)) | |
53 | 53 | then throw(("Payment amount must be greater then threshold " + toString(stakeAmountThreshold))) | |
54 | 54 | else payments[0].amount | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func getCurrentLockedAmount (user) = valueOrElse(getInteger(this, key_UserStakedTotal(user)), 0) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func stake (inv,rewardType,daysToLock,beneficiary) = { | |
61 | 61 | let callerStr = toString(inv.caller) | |
62 | 62 | let pmtAmount = extractPaymentAmount(inv.payments) | |
63 | 63 | let beginningOfNexDayTimestamp = ((currentTimestamp + hours24) - (currentTimestamp % hours24)) | |
64 | 64 | let lockUntilTimestamp = (beginningOfNexDayTimestamp + (daysToLock * hours24)) | |
65 | 65 | 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)], ",") | |
67 | 67 | if ((inv.transactionId == lastStakeTxId)) | |
68 | 68 | then throw("There is only one staking per transaction allowed for now") | |
69 | 69 | else if (isDefined(getString(this, stakingKey))) | |
70 | 70 | then throw((("Staking '" + stakingKey) + "' already exists")) | |
71 | 71 | else if (!(containsElement(possibleTokensForRewards, rewardType))) | |
72 | 72 | then throw((("Unsupported reward type '" + rewardType) + "'")) | |
73 | 73 | else if (!(containsElement(lockPeriodsInDays, daysToLock))) | |
74 | 74 | then throw((("Unsupported number of days " + toString(daysToLock)) + " to mine")) | |
75 | 75 | 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))] | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | @Callable(inv) | |
80 | 80 | func init (hashrateTokenIssuer) = { | |
81 | 81 | let issuer = valueOrErrorMessage(addressFromString(hashrateTokenIssuer), (("Can't parse issuer address '" + hashrateTokenIssuer) + "'")) | |
82 | 82 | let assetIdStr = valueOrErrorMessage(getString(issuer, key_Issuer_AssetId), ((("Can't find entry '" + key_Issuer_AssetId) + "' at address ") + hashrateTokenIssuer)) | |
83 | 83 | let newAssetId = valueOrErrorMessage(assetInfo(fromBase58String(assetIdStr)), (("Can't find asset '" + assetIdStr) + "'")).id | |
84 | 84 | if ((inv.caller != this)) | |
85 | 85 | then throw("Only the DApp itself can call this function") | |
86 | 86 | else if (isDAppInit) | |
87 | 87 | 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))] | |
89 | 89 | } | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | ||
93 | 93 | @Callable(inv) | |
94 | 94 | func setPromoDApp (address) = if (isDefined(getString(this, key_PromoDApp))) | |
95 | 95 | then throw("Promo DApp address is already specified") | |
96 | 96 | else [StringEntry(key_PromoDApp, toString(valueOrErrorMessage(addressFromString(address), (("Can't parse '" + address) + "' as address"))))] | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | ||
100 | 100 | @Callable(inv) | |
101 | 101 | func lock (rewardType,daysToLock) = stake(inv, rewardType, daysToLock, inv.caller) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | ||
105 | 105 | @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"))) | |
107 | 109 | ||
108 | 110 | ||
109 | 111 | ||
110 | 112 | @Callable(inv) | |
111 | 113 | func unlock (user,staking) = { | |
112 | 114 | let userAddress = valueOrErrorMessage(addressFromString(user), (("Can't parse user address '" + user) + "'")) | |
113 | 115 | func extractStaking (acc,txId) = { | |
114 | 116 | let parameters = { | |
115 | 117 | let val = split(valueOrErrorMessage(getString(this, key_UserStaking(user, txId)), ((("Staking " + txId) + " doesn't exist for user ") + user)), ",") | |
116 | 118 | if ((size(val) != 6)) | |
117 | 119 | then throw(("Can't parse parameters of staking " + txId)) | |
118 | 120 | else if ((val[0] != ACTIVE)) | |
119 | 121 | then throw((("staking '" + txId) + "' is already unlocked")) | |
120 | 122 | else val | |
121 | 123 | } | |
122 | - | let $ | |
123 | - | let amount = $ | |
124 | - | let lockUntil = $ | |
124 | + | let $t059746062 = $Tuple2(parseIntValue(parameters[1]), parseIntValue(parameters[5])) | |
125 | + | let amount = $t059746062._1 | |
126 | + | let lockUntil = $t059746062._2 | |
125 | 127 | if ((lockUntil > currentTimestamp)) | |
126 | 128 | then throw(((("Unable to withdraw staking " + txId) + " because it is still locked until ") + toString(lockUntil))) | |
127 | 129 | else $Tuple2((acc._1 :+ StringEntry(((user + "_") + txId), makeString([FINISHED, parameters[1], parameters[2], parameters[3], parameters[4], parameters[5]], ","))), (acc._2 + amount)) | |
128 | 130 | } | |
129 | 131 | ||
130 | - | let $ | |
132 | + | let $t064546532 = { | |
131 | 133 | let $l = staking | |
132 | 134 | let $s = size($l) | |
133 | 135 | let $acc0 = $Tuple2(nil, 0) | |
134 | 136 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
135 | 137 | then $a | |
136 | 138 | else extractStaking($a, $l[$i]) | |
137 | 139 | ||
138 | 140 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
139 | 141 | then $a | |
140 | 142 | else throw("List size exceeds 10") | |
141 | 143 | ||
142 | 144 | $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) | |
143 | 145 | } | |
144 | - | let unstakeList = $ | |
145 | - | let totalUnstaked = $ | |
146 | + | let unstakeList = $t064546532._1 | |
147 | + | let totalUnstaked = $t064546532._2 | |
146 | 148 | let userTotalKey = key_UserStakedTotal(user) | |
147 | 149 | let userTotal = valueOrElse(getInteger(this, userTotalKey), 0) | |
148 | 150 | let userTotalAfter = (userTotal - totalUnstaked) | |
149 | 151 | if ((size(inv.payments) != 0)) | |
150 | 152 | then throw("There should be no payments for this function") | |
151 | 153 | else if (if ((inv.caller != this)) | |
152 | 154 | then (userAddress != inv.caller) | |
153 | 155 | else false) | |
154 | 156 | then throw("Only users themselves can withdraw their unlocked staking, or admin for them") | |
155 | 157 | else if ((userAddress == promoDApp)) | |
156 | 158 | then throw("Promo staking can be unlocked only by Promo DApp only") | |
157 | 159 | else if (if (if ((0 > userTotal)) | |
158 | 160 | then true | |
159 | 161 | else (0 > totalUnstaked)) | |
160 | 162 | then true | |
161 | 163 | else (0 > userTotalAfter)) | |
162 | 164 | then throw("negative result") | |
163 | 165 | else (unstakeList ++ [IntegerEntry(key_StakedTotal, (stakedTotal - totalUnstaked)), if ((userTotalAfter > 0)) | |
164 | 166 | then IntegerEntry(userTotalKey, userTotalAfter) | |
165 | 167 | else DeleteEntry(userTotalKey), ScriptTransfer(userAddress, totalUnstaked, hashrateTokenId)]) | |
166 | 168 | } | |
167 | 169 | ||
168 | 170 |
github/deemru/w8io/169f3d6 63.82 ms ◑