tx · CncF2eq24FT7AgN7PvUyFwbWFpPZE5LS5tfpFXWinKn5

3N4UhavKsWv4dPmmhtaYT573ALxuvsAp6M4:  -0.01400000 Waves

2022.06.07 14:48 [2085907] smart account 3N4UhavKsWv4dPmmhtaYT573ALxuvsAp6M4 > SELF 0.00000000 Waves

{ "type": 13, "id": "CncF2eq24FT7AgN7PvUyFwbWFpPZE5LS5tfpFXWinKn5", "fee": 1400000, "feeAssetId": null, "timestamp": 1654602499298, "version": 2, "chainId": 84, "sender": "3N4UhavKsWv4dPmmhtaYT573ALxuvsAp6M4", "senderPublicKey": "5nJ4v4Wx6sdXhiDZNrpW7m1aSDsTgTgFJVBgmPMPtbUM", "proofs": [ "3aEKWs9KcAken4Mj23JFcnzY7rMiXhbHxR6sFBn4qTpBQLDrL9ip9MNJfheTiY3Scn4Zb6dhCDjH55VXDMUfeKun" ], "script": "base64:AAIFAAAAAAAAACIIAhIFCgMICAESBgoECAgBARIFCgMICAESAwoBCBIDCgEIAAAAFwAAAAAGc3Rha2VyAgAAAAZzdGFrZXIAAAAABWFkbWluAgAAAAZhZG1pbl8AAAAAC2Fzc2V0SWRDYWxsAgAAAAhBc3NldCBJRAAAAAAKZW50cnlJbmRleAIAAAAMX0VudHJ5X0luZGV4AAAAAApBUFlfQW1vdW50AgAAAAtfQVBZX0Ftb3VudAEAAAAEZ2V0SQAAAAEAAAADa2V5CQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQEAAAAEZ2V0UwAAAAEAAAADa2V5CQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQEAAAAFZ2V0SVYAAAABAAAAA2tleQkBAAAABXZhbHVlAAAAAQkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkBAAAABWdldFNWAAAAAQAAAANrZXkJAQAAAAV2YWx1ZQAAAAEJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AQAAAAd0aHJvd0lmAAAAAgAAAAljb25kaXRpb24AAAAFZXJyb3IDBQAAAAljb25kaXRpb24JA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AAAA1zdGFrZXJBZGRyZXNzCQACWQAAAAEJAQAAAAVnZXRTVgAAAAECAAAABnN0YWtlcgQAAAADcnVuCQAD/AAAAAQJAQAAAAdBZGRyZXNzAAAAAQUAAAANc3Rha2VyQWRkcmVzcwIAAAATX2dldEFzc2V0SWRCeVRpY2tlcgkABEwAAAACBQAAAAtBc3NldFRpY2tlcgUAAAADbmlsBQAAAANuaWwEAAAAByRtYXRjaDAFAAAAA3J1bgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIFAAAAC2Fzc2V0SWRDYWxsBQAAAAFhBQAAAANuaWwFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAAADhv4hw==", "height": 2085907, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AhJ9gN3q52mB3XWGJZdgbYBTSocn5f8uHFzMUBXyX7wP Next: D3RrRxANwZrW9uB6F5xnbJWUVdVEz16ARpqu9ynspmbH Diff:
OldNewDifferences
119119
120120
121121 @Callable(i)
122-func getAPYAmount (user,AssetTicker,AmountLocked,uIndex) = {
122+func getAPYAmount (user,AssetTicker,EntryIndex) = {
123123 let check = stakerOnly(i)
124124 if ((check == check))
125125 then {
126- let uEntryToString = ((((user + "_") + AssetTicker) + "_") + toString(uIndex))
127- let uIndexValue = valueOrErrorMessage(getS(uEntryToString), ("no entry for " + user))
128- let uUser = (uIndexValue + APY_Amount)
129- let uAPYAmount = valueOrErrorMessage(getI(uUser), ("APY not computed for " + user))
126+ let uEntryToString = ((((user + "_") + AssetTicker) + "_") + toString(EntryIndex))
127+ let uAPY = (uEntryToString + APY_Amount)
128+ let uAPYAmount = valueOrErrorMessage(getI(uAPY), ("APY not computed for " + user))
130129 $Tuple2(nil, uAPYAmount)
131130 }
132131 else throw("Strict value is not equal to itself.")
135134
136135
137136 @Callable(i)
138-func storeAPYAmount (user,AssetTicker,APYAmount) = {
137+func storeAPYAmount (user,AssetTicker,APYAmount,EntryIndex) = {
139138 let check = adminOnly(i)
140139 if ((check == check))
141140 then {
142141 let uEntryIndex = (((user + "_") + AssetTicker) + entryIndex)
143- let uIndex = incrementEntryIndex(uEntryIndex)
144- let uEntryToString = ((((user + "_") + AssetTicker) + "_") + toString(uIndex))
145- let uAPY = (uEntryIndex + APY_Amount)
146-[writeConstInteger(uEntryToString, uIndex), writeConstInteger(uAPY, value(APYAmount))]
142+ let uEntryToString = ((((user + "_") + AssetTicker) + "_") + toString(EntryIndex))
143+ let uAPY = (uEntryToString + APY_Amount)
144+[writeConstInteger(uEntryToString, EntryIndex), writeConstInteger(uAPY, value(APYAmount))]
147145 }
148146 else throw("Strict value is not equal to itself.")
149147 }
151149
152150
153151 @Callable(i)
154-func deleteAPYAmount (user,AssetTicker,AmountLocked,APYAmount) = {
152+func deleteAPYAmount (user,AssetTicker,EntryIndex) = {
155153 let check = adminOnly(i)
156154 if ((check == check))
157155 then {
158156 let uEntryIndex = ((((user + "_") + AssetTicker) + "_APY_") + entryIndex)
159- let uIndex = incrementEntryIndex(uEntryIndex)
160- let uAPY = (((((((((user + "_") + AssetTicker) + "_APY_Amount_") + "(") + toString(AmountLocked)) + AssetTicker) + ")") + "_") + toString(uIndex))
157+ let uEntryToString = ((((user + "_") + AssetTicker) + "_") + toString(EntryIndex))
158+ let uAPY = (uEntryToString + APY_Amount)
161159 [DeleteEntry(uAPY)]
162160 }
163161 else throw("Strict value is not equal to itself.")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let staker = "staker"
55
66 let admin = "admin_"
77
88 let assetIdCall = "Asset ID"
99
1010 let entryIndex = "_Entry_Index"
1111
1212 let APY_Amount = "_APY_Amount"
1313
1414 func getI (key) = getInteger(this, key)
1515
1616
1717 func getS (key) = getString(this, key)
1818
1919
2020 func getIV (key) = value(getInteger(this, key))
2121
2222
2323 func getSV (key) = value(getString(this, key))
2424
2525
2626 func throwIf (condition,error) = if (condition)
2727 then throw(error)
2828 else true
2929
3030
3131 let thirtyDaysLockPeriod = 30
3232
3333 let sixtyDaysLockPeriod = 60
3434
3535 let ninetyDaysLockPeriod = 90
3636
3737 func throwOrReturnI (val,error) = match val {
3838 case val: Int =>
3939 val
4040 case _ =>
4141 throw(error)
4242 }
4343
4444
4545 func throwOrReturnS (val,error) = match val {
4646 case val: String =>
4747 val
4848 case _ =>
4949 throw(error)
5050 }
5151
5252
5353 func writeInt (key,value) = if ((0 > value))
5454 then throw(((("writing negative value " + toString(value)) + " for key ") + key))
5555 else IntegerEntry(key, value)
5656
5757
5858 func writeStr (key,value) = if ((" " == value))
5959 then throw(("writing an empty string " + value))
6060 else StringEntry(key, value)
6161
6262
6363 func writeConstString (key,value) = if (!(isDefined(getS(key))))
6464 then writeStr(key, value)
6565 else throw(("already initialized: " + key))
6666
6767
6868 func writeConstInteger (key,value) = if (!(isDefined(getS(key))))
6969 then writeInt(key, value)
7070 else throw(("already initialized: " + key))
7171
7272
7373 func adminOnly (i) = {
7474 let inputAddress = toBase58String(i.caller.bytes)
7575 let otherAdmin = (admin + inputAddress)
7676 match getS(admin) {
7777 case a: String =>
7878 if ((inputAddress != getS(admin)))
7979 then throw("unauthorized")
8080 else true
8181 case _ =>
8282 match getS(otherAdmin) {
8383 case b: String =>
8484 if ((inputAddress != getS(otherAdmin)))
8585 then throw("unauthorized")
8686 else true
8787 case _ =>
8888 throw("unauthorizd")
8989 }
9090 }
9191 }
9292
9393
9494 func stakerOnly (i) = {
9595 let inputAddress = toBase58String(i.caller.bytes)
9696 let check = if ((inputAddress != getS(staker)))
9797 then throw("unauthorized")
9898 else true
9999 check
100100 }
101101
102102
103103 func writeConfigValue (key,data) = match data {
104104 case data: String =>
105105 writeConstString(key, data)
106106 case data: Int =>
107107 writeConstInteger(key, data)
108108 case _ =>
109109 throw("unsupported config type")
110110 }
111111
112112
113113 func incrementEntryIndex (key) = {
114114 let uIndex = getI(key)
115115 if (isDefined(uIndex))
116116 then (value(uIndex) + 1)
117117 else 0
118118 }
119119
120120
121121 @Callable(i)
122-func getAPYAmount (user,AssetTicker,AmountLocked,uIndex) = {
122+func getAPYAmount (user,AssetTicker,EntryIndex) = {
123123 let check = stakerOnly(i)
124124 if ((check == check))
125125 then {
126- let uEntryToString = ((((user + "_") + AssetTicker) + "_") + toString(uIndex))
127- let uIndexValue = valueOrErrorMessage(getS(uEntryToString), ("no entry for " + user))
128- let uUser = (uIndexValue + APY_Amount)
129- let uAPYAmount = valueOrErrorMessage(getI(uUser), ("APY not computed for " + user))
126+ let uEntryToString = ((((user + "_") + AssetTicker) + "_") + toString(EntryIndex))
127+ let uAPY = (uEntryToString + APY_Amount)
128+ let uAPYAmount = valueOrErrorMessage(getI(uAPY), ("APY not computed for " + user))
130129 $Tuple2(nil, uAPYAmount)
131130 }
132131 else throw("Strict value is not equal to itself.")
133132 }
134133
135134
136135
137136 @Callable(i)
138-func storeAPYAmount (user,AssetTicker,APYAmount) = {
137+func storeAPYAmount (user,AssetTicker,APYAmount,EntryIndex) = {
139138 let check = adminOnly(i)
140139 if ((check == check))
141140 then {
142141 let uEntryIndex = (((user + "_") + AssetTicker) + entryIndex)
143- let uIndex = incrementEntryIndex(uEntryIndex)
144- let uEntryToString = ((((user + "_") + AssetTicker) + "_") + toString(uIndex))
145- let uAPY = (uEntryIndex + APY_Amount)
146-[writeConstInteger(uEntryToString, uIndex), writeConstInteger(uAPY, value(APYAmount))]
142+ let uEntryToString = ((((user + "_") + AssetTicker) + "_") + toString(EntryIndex))
143+ let uAPY = (uEntryToString + APY_Amount)
144+[writeConstInteger(uEntryToString, EntryIndex), writeConstInteger(uAPY, value(APYAmount))]
147145 }
148146 else throw("Strict value is not equal to itself.")
149147 }
150148
151149
152150
153151 @Callable(i)
154-func deleteAPYAmount (user,AssetTicker,AmountLocked,APYAmount) = {
152+func deleteAPYAmount (user,AssetTicker,EntryIndex) = {
155153 let check = adminOnly(i)
156154 if ((check == check))
157155 then {
158156 let uEntryIndex = ((((user + "_") + AssetTicker) + "_APY_") + entryIndex)
159- let uIndex = incrementEntryIndex(uEntryIndex)
160- let uAPY = (((((((((user + "_") + AssetTicker) + "_APY_Amount_") + "(") + toString(AmountLocked)) + AssetTicker) + ")") + "_") + toString(uIndex))
157+ let uEntryToString = ((((user + "_") + AssetTicker) + "_") + toString(EntryIndex))
158+ let uAPY = (uEntryToString + APY_Amount)
161159 [DeleteEntry(uAPY)]
162160 }
163161 else throw("Strict value is not equal to itself.")
164162 }
165163
166164
167165
168166 @Callable(i)
169167 func init (stakerAddress) = [writeConstString(staker, stakerAddress), writeConstString(admin, toBase58String(this.bytes))]
170168
171169
172170
173171 @Callable(i)
174172 func getAssetIdByTicker (AssetTicker) = {
175173 let checks = adminOnly(i)
176174 if ((checks == checks))
177175 then {
178176 let stakerAddress = fromBase58String(getSV("staker"))
179177 let run = invoke(Address(stakerAddress), "_getAssetIdByTicker", [AssetTicker], nil)
180178 match run {
181179 case a: String =>
182180 [StringEntry(assetIdCall, a)]
183181 case _ =>
184182 nil
185183 }
186184 }
187185 else throw("Strict value is not equal to itself.")
188186 }
189187
190188

github/deemru/w8io/026f985 
44.91 ms