tx · 2gVDhZ8weEKXjsrpqPRbLJn4y7eYuRoaJZCE9TAb6gLA

3MuGfNhF98CNBCfthhoJEo6SYUv7zTgkK4J:  -0.01000000 Waves

2022.03.02 23:02 [1946808] smart account 3MuGfNhF98CNBCfthhoJEo6SYUv7zTgkK4J > SELF 0.00000000 Waves

{ "type": 13, "id": "2gVDhZ8weEKXjsrpqPRbLJn4y7eYuRoaJZCE9TAb6gLA", "fee": 1000000, "feeAssetId": null, "timestamp": 1646251352998, "version": 1, "sender": "3MuGfNhF98CNBCfthhoJEo6SYUv7zTgkK4J", "senderPublicKey": "4DthuG3xjZV9WtZ34Y66AummdAr67wRzwWsVQL4y2bob", "proofs": [ "4sFeuVhTyAbhZKAyfYNm6Rp751sHoGNwFn8Xth4Vtb84vwaov4uz542Go3GekDnzReyeW3brKYmZi1UrTHLdZTUe" ], "script": "base64:AAIFAAAAAAAAABsIAhIGCgQICAEBEgASAwoBARIDCgEIEgMKAQgAAAAbAAAAAAlzZXBhcmF0b3ICAAAAAl9fAAAAAAVNVUxUOAAAAAAABfXhAAEAAAAMa2V5Qm9uZEFzc2V0AAAAAAIAAAANYm9uZF9hc3NldF9pZAEAAAAZa2V5QXVjdGlvbkNvbnRyYWN0QWRkcmVzcwAAAAACAAAAEGF1Y3Rpb25fY29udHJhY3QBAAAAGmtleU5ldXRyaW5vQ29udHJhY3RBZGRyZXNzAAAAAAIAAAAbJXNfX25ldXRyaW5vQ29udHJhY3RBZGRyZXNzAQAAABZrZXlNYXRoQ29udHJhY3RBZGRyZXNzAAAAAAIAAAAQJXNfX21hdGhDb250cmFjdAEAAAAQa2V5TWluTG9ja0Ftb3VudAAAAAACAAAAESVzX19taW5Mb2NrQW1vdW50AQAAAAtrZXlIYWxmTGlmZQAAAAACAAAADCVzX19oYWxmTGlmZQEAAAAWa2V5TG9ja1BhcmFtVXNlckFtb3VudAAAAAEAAAALdXNlckFkZHJlc3MJAAS5AAAAAgkABEwAAAACAgAAAAYlcyVzJXMJAARMAA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XNlclBhcmFtc09yRmFpbAAAAAEFAAAAC3VzZXJBZGRyZXNzBAAAAAZhbW91bnQIBQAAAAskdDA3NTE1NzU3MAAAAAJfMQQAAAAFc3RhcnQIBQAAAAskdDA3NTE1NzU3MAAAAAJfMgkABRQAAAACBQAAAANuaWwJAAUUAAAAAgUAAAAGYW1vdW50BQAAAAVzdGFydAkABRQAAAACBQAAAANuaWwJAAUUAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAQAAAAHbnNidEFtdAgFAAAACyR0MDczMjY3NjI2AAAAAl8xBAAAAAxzdGFraW5nU3RhcnQIBQAAAAskdDA3MzI2NzYyNgAAAAJfMgkABRQAAAACBQAAAANuaWwJAAUUAAAAAgUAAAAHbnNidEFtdAUAAAAMc3Rha2luZ1N0YXJ0AAAAADxIJAQ=", "chainId": 84, "height": 1946808, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 6QSZ8tuWBu3ux4tWRxSGi3fZ6ajv3wR8tuE8fkF56ArW Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 5 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let separator = "__"
5+
6+let MULT8 = 100000000
7+
8+func keyBondAsset () = "bond_asset_id"
9+
10+
11+func keyAuctionContractAddress () = "auction_contract"
12+
13+
14+func keyNeutrinoContractAddress () = "%s__neutrinoContractAddress"
15+
16+
17+func keyMathContractAddress () = "%s__mathContract"
18+
19+
20+func keyMinLockAmount () = "%s__minLockAmount"
21+
22+
23+func keyHalfLife () = "%s__halfLife"
24+
25+
26+func keyLockParamUserAmount (userAddress) = makeString(["%s%s%s", "paramByUser", toString(userAddress), "amount"], separator)
27+
28+
29+func keyLockParamStartBlock (userAddress) = makeString(["%s%s%s", "paramByUser", toString(userAddress), "start"], separator)
30+
31+
32+func keyHistoryRecord (type,userAddress,txId) = makeString(["%s%s%s%s", "history", type, toString(userAddress), toBase58String(txId)], separator)
33+
34+
35+func keyLockParamTotalAmount () = makeString(["%s%s", "stats", "activeTotalLocked"], separator)
36+
37+
38+func keyStatsLocksCount () = makeString(["%s%s", "stats", "locksCount"], separator)
39+
40+
41+func keyStatsUsersCount () = makeString(["%s%s", "stats", "activeUsersCount"], separator)
42+
43+
44+func keyNextPeriod () = "%s__nextPeriod"
45+
46+
47+func getIntOrZero (key) = valueOrElse(getInteger(this, key), 0)
48+
49+
50+func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (("Mandatory this." + key) + " is not defined"))
51+
52+
53+func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (("Mandatory this." + key) + " is not defined"))
54+
55+
56+func asInt (val) = match val {
57+ case valInt: Int =>
58+ valInt
59+ case _ =>
60+ throw("fail to cast into Int")
61+}
62+
63+
64+func formatHistoryRecord (oldAmount,oldStart,newAmount,newStart) = makeString(["%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(oldAmount), toString(oldStart), toString(newAmount), toString(newStart)], separator)
65+
66+
67+func HistoryRecordEntry (type,userAddress,txId,oldAmount,oldStart,newAmount,newStart) = StringEntry(keyHistoryRecord(type, userAddress, txId), formatHistoryRecord(oldAmount, oldStart, newAmount, newStart))
68+
69+
70+func StatsEntry (totalLockedInc,lockCountInc,usersCountInc) = {
71+ let locksCount = getIntOrZero(keyStatsLocksCount())
72+ let usersCount = getIntOrZero(keyStatsUsersCount())
73+ let totalAmount = getIntOrZero(keyLockParamTotalAmount())
74+[IntegerEntry(keyStatsLocksCount(), (locksCount + lockCountInc)), IntegerEntry(keyStatsUsersCount(), (usersCount + usersCountInc)), IntegerEntry(keyLockParamTotalAmount(), (totalAmount + totalLockedInc))]
75+ }
76+
77+
78+func LockParamsEntry (userAddress,amount,start) = [IntegerEntry(keyLockParamUserAmount(userAddress), amount), IntegerEntry(keyLockParamStartBlock(userAddress), start)]
79+
80+
81+func getParamsOrFail () = {
82+ let neutrinoContract = addressFromStringValue(getStringOrFail(keyNeutrinoContractAddress()))
83+ $Tuple4(fromBase58String(getStringValue(neutrinoContract, keyAuctionContractAddress())), fromBase58String(getStringValue(neutrinoContract, keyBondAsset())), getIntOrFail(keyMinLockAmount()), getIntOrFail(keyHalfLife()))
84+ }
85+
86+
87+func isUserExists (userAddress) = isDefined(getInteger(this, keyLockParamStartBlock(userAddress)))
88+
89+
90+func getUserParamsOrUnit (userAddress) = if (isUserExists(userAddress))
91+ then $Tuple2(getIntOrFail(keyLockParamUserAmount(userAddress)), getIntOrFail(keyLockParamStartBlock(userAddress)))
92+ else unit
93+
94+
95+func getUserParamsOrFail (userAddress) = valueOrErrorMessage(getUserParamsOrUnit(userAddress), (("User " + toString(userAddress)) + " is not defined"))
96+
97+
98+@Callable(i)
99+func constructor (neutrinoContractAddress,mathContractAddress,minLockAmount,halfLife) = if ((i.caller != this))
100+ then throw("Permission denied")
101+ else [StringEntry(keyNeutrinoContractAddress(), neutrinoContractAddress), StringEntry(keyMathContractAddress(), mathContractAddress), IntegerEntry(keyMinLockAmount(), minLockAmount), IntegerEntry(keyHalfLife(), halfLife)]
102+
103+
104+
105+@Callable(i)
106+func stake () = {
107+ let $t044424521 = getParamsOrFail()
108+ let auctionContract = $t044424521._1
109+ let bondAssetId = $t044424521._2
110+ let minLockAmount = $t044424521._3
111+ let halfLife = $t044424521._4
112+ if ((size(i.payments) != 1))
113+ then throw("Invalid payments size")
114+ else {
115+ let payment = i.payments[0]
116+ let amount = payment.amount
117+ let invalidAssetMessage = (("Invalid asset. " + toBase58String(bondAssetId)) + " is expected")
118+ let assetId = valueOrErrorMessage(payment.assetId, invalidAssetMessage)
119+ if ((assetId != bondAssetId))
120+ then throw(invalidAssetMessage)
121+ else {
122+ let userAddress = i.caller
123+ let $t050205192 = match getUserParamsOrUnit(userAddress) {
124+ case p: (Int, Int) =>
125+ $Tuple3(false, p._1, p._2)
126+ case _: Unit =>
127+ $Tuple3(true, 0, -1)
128+ case _ =>
129+ throw("Match error")
130+ }
131+ let isNewUser = $t050205192._1
132+ let lockAmount = $t050205192._2
133+ let lockStartHeight = $t050205192._3
134+ let mergedAmount = if (isNewUser)
135+ then amount
136+ else (amount + lockAmount)
137+ let mergedStartHeight = if (isNewUser)
138+ then height
139+ else {
140+ let mathContract = addressFromStringValue(getStringOrFail(keyMathContractAddress()))
141+ asInt(invoke(mathContract, "mergeStakesMATH", [amount, height, lockAmount, lockStartHeight], nil))
142+ }
143+ if ((minLockAmount > mergedAmount))
144+ then throw(("Min lock amount is " + toString(minLockAmount)))
145+ else (([HistoryRecordEntry("stake", userAddress, i.transactionId, lockAmount, lockStartHeight, mergedAmount, mergedStartHeight)] ++ LockParamsEntry(userAddress, mergedAmount, mergedStartHeight)) ++ StatsEntry(amount, 1, if (isNewUser)
146+ then 1
147+ else 0))
148+ }
149+ }
150+ }
151+
152+
153+
154+@Callable(i)
155+func unstake (amount) = {
156+ let userAddress = i.caller
157+ let $t059606038 = getParamsOrFail()
158+ let auctionAddress = $t059606038._1
159+ let bondAssetId = $t059606038._2
160+ let minLockAmount = $t059606038._3
161+ let halfLife = $t059606038._4
162+ let $t060416104 = getUserParamsOrFail(userAddress)
163+ let lockAmount = $t060416104._1
164+ let lockStart = $t060416104._2
165+ if ((0 >= lockAmount))
166+ then throw("Nothing to unstake")
167+ else if ((amount > lockAmount))
168+ then throw(((("Requested " + toString(amount)) + ", but staked only ") + toString(lockAmount)))
169+ else {
170+ let mathContract = addressFromStringValue(getStringOrFail(keyMathContractAddress()))
171+ let comissionAmount = asInt(invoke(mathContract, "getUnstakeComissionAmountMATH", [amount, lockStart], nil))
172+ (([ScriptTransfer(userAddress, (amount - comissionAmount), bondAssetId), ScriptTransfer(Address(auctionAddress), comissionAmount, bondAssetId), HistoryRecordEntry("unstake", userAddress, i.transactionId, lockAmount, lockStart, (lockAmount - amount), lockStart)] ++ LockParamsEntry(userAddress, (lockAmount - amount), lockStart)) ++ StatsEntry(-(amount), if ((amount == lockAmount))
173+ then -1
174+ else 0, if ((amount == lockAmount))
175+ then -1
176+ else 0))
177+ }
178+ }
179+
180+
181+
182+@Callable(i)
183+func gNsbtAmountREADONLY (userAddressStr) = {
184+ let userAddress = addressFromStringValue(userAddressStr)
185+ $Tuple2(nil, if (isUserExists(userAddress))
186+ then getUserParamsOrFail(userAddress)._1
187+ else 0)
188+ }
189+
190+
191+
192+@Callable(i)
193+func nsbtStakingInfoWrapperREADONLY (userAddressStr) = {
194+ let $t073267626 = if ((userAddressStr == ""))
195+ then $Tuple2(0, 0)
196+ else {
197+ let userAddress = addressFromStringValue(userAddressStr)
198+ if (isUserExists(userAddress))
199+ then {
200+ let $t075157570 = getUserParamsOrFail(userAddress)
201+ let amount = $t075157570._1
202+ let start = $t075157570._2
203+ $Tuple2(nil, $Tuple2(amount, start))
204+ }
205+ else $Tuple2(nil, $Tuple2(0, 0))
206+ }
207+ let nsbtAmt = $t073267626._1
208+ let stakingStart = $t073267626._2
209+ $Tuple2(nil, $Tuple2(nsbtAmt, stakingStart))
210+ }
211+
212+

github/deemru/w8io/026f985 
19.57 ms