tx · 9ztzQgPSq8PsTRyFXwUw7t9HigRkDh5SXETVMLweEGxc

3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB:  -0.01000000 Waves

2023.09.22 22:32 [2767019] smart account 3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB > SELF 0.00000000 Waves

{ "type": 13, "id": "9ztzQgPSq8PsTRyFXwUw7t9HigRkDh5SXETVMLweEGxc", "fee": 1000000, "feeAssetId": null, "timestamp": 1695411160990, "version": 2, "chainId": 84, "sender": "3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB", "senderPublicKey": "8M2WuphuhMvTZMcpBocfLqUvkcFJisjdcCZaaPHxpwmS", "proofs": [ "5dcAGiwLAEfPNSzK1J5LJGChDf1HWdYRkRwqgtbTnP1HqMoKSY5eNDBBuxzyiaR3XYeRE5CBrETPHNtzzmjiS4Df" ], "script": "base64:BgLRAggCEgASAwoBARIAEgAiBnVzZG5JZCIJdXNkbklkU3RyIghwdXp6bGVJZCILcHV6emxlSWRTdHIiBVNjYWxlIg10cnlHZXRJbnRlZ2VyIgNrZXkiByRtYXRjaDAiAWIiDHRyeUdldFN0cmluZyIBYSIQY2xhaW1BbGlhc1Jlc3VsdCIHYWRkcmVzcyIKYXNzZXRJZFN0ciIKYWRkcmVzc1N0ciIPY3VycmVudEludGVyZXN0IgxzdGFrZWRBbW91bnQiGGxhc3RDaGVja0ludGVyZXN0SW5TdGF0ZSIRbGFzdENoZWNrSW50ZXJlc3QiBnJld2FyZCILY2xhaW1SZXN1bHQiAWkiBmFtb3VudCIRdG90YWxTdGFrZWRBbW91bnQiCHBtdEFzc2V0IglwbXRBbW91bnQiDWludGVyZXN0RGVsdGEiAnR4IgZ2ZXJpZnkJAAFhASBvJKPKqzDcUimY6CxhWu5afyNNwi11u+mdqlTg0tAHwQABYgIsOFVyZkRWZDVHcmVlVXdtN3VQazdlWXoxZU12Mzc2a3pSNTJDNnNBTlBrd1MAAWMBIGEgR2q15TSU04z5reN5xPpwl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hcm5pbmdzBQF3CQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIJAKwCAgIRZ2xvYmFsX2xhc3RDaGVja18FAWQCCV9pbnRlcmVzdAkAZAIFAXAFAUEFA25pbAUBdwUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQFCAQFDAAkA9AMDCAUBQglib2R5Qnl0ZXMJAJEDAggFAUIGcHJvb2ZzAAAIBQFCD3NlbmRlclB1YmxpY0tlebItLCE=", "height": 2767019, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7i3uFq7Zwa4QR3nt8AAYj4KQXAHRivDERUSHzUqSkjH2 Next: G9SDj9hCvsEQ93imTka9JKCfhrjbmUDY8dGj2EVcv8eL Diff:
OldNewDifferences
8282 func topUpReward () = {
8383 let y = value(v.payments[0].assetId)
8484 let z = v.payments[0].amount
85- let w = if ((y == c))
85+ let w = if ((y == a))
8686 then 0
87- else if ((y == a))
87+ else if ((y == c))
8888 then z
8989 else throw("not correct asset attached")
9090 if ((w == w))
9191 then {
92- let p = f((("global_lastCheck_" + b) + "_interest"))
92+ let p = f((("global_lastCheck_" + d) + "_interest"))
9393 let x = f("global_staked")
9494 let A = if ((x > 0))
9595 then fraction(w, e, x)
9696 else 0
9797 if ((y != a))
98- then $Tuple2([IntegerEntry((("global_" + b) + "_earnings"), (f((("global_" + b) + "_earnings")) + w)), IntegerEntry((("global_lastCheck_" + b) + "_interest"), (p + A))], w)
98+ then $Tuple2([IntegerEntry((("global_" + d) + "_earnings"), (f((("global_" + d) + "_earnings")) + w)), IntegerEntry((("global_lastCheck_" + d) + "_interest"), (p + A))], w)
9999 else nil
100100 }
101101 else throw("Strict value is not equal to itself.")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS'
55
66 let b = "8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS"
77
88 let c = base58'7Y96UTbBQ45cjWoHeFj2EhnjdgEt6iK2LnA4eTcfxdoD'
99
1010 let d = "7Y96UTbBQ45cjWoHeFj2EhnjdgEt6iK2LnA4eTcfxdoD"
1111
1212 let e = 1000000000000
1313
1414 func f (g) = {
1515 let h = getInteger(this, g)
1616 if ($isInstanceOf(h, "Int"))
1717 then {
1818 let i = h
1919 i
2020 }
2121 else 0
2222 }
2323
2424
2525 func j (g) = {
2626 let h = getString(this, g)
2727 if ($isInstanceOf(h, "String"))
2828 then {
2929 let k = h
3030 k
3131 }
3232 else ""
3333 }
3434
3535
3636 func l (m,n) = {
3737 let o = toString(m)
3838 let p = f((("global_lastCheck_" + n) + "_interest"))
3939 let q = f((o + "_staked"))
4040 let r = f((((o + "_lastCheck_") + n) + "_interest"))
4141 let s = if ((r == 0))
4242 then 0
4343 else r
4444 let t = fraction((p - s), q, e)
4545 [IntegerEntry((((o + "_lastCheck_") + n) + "_interest"), p), IntegerEntry((((o + "_") + n) + "_claimed"), (f((((o + "_") + n) + "_claimed")) + t)), ScriptTransfer(m, t, fromBase58String(n))]
4646 }
4747
4848
4949 func u (m) = (l(m, b) ++ l(m, d))
5050
5151
5252 @Callable(v)
5353 func stake () = {
5454 let w = v.payments[0].amount
5555 let o = toString(v.caller)
5656 let n = toBase58String(a)
5757 let x = f("global_staked")
5858 if ((v.payments[0].assetId != c))
5959 then throw("wrong asset attached")
6060 else (u(v.caller) ++ [IntegerEntry("global_staked", (x + w)), IntegerEntry((o + "_staked"), (f((o + "_staked")) + w))])
6161 }
6262
6363
6464
6565 @Callable(v)
6666 func unStake (w) = {
6767 let o = toString(v.caller)
6868 let q = f((o + "_staked"))
6969 if ((w > q))
7070 then throw("you don't have tokens available")
7171 else (u(v.caller) ++ [IntegerEntry((o + "_staked"), (q - w)), IntegerEntry("global_staked", (f("global_staked") - w)), ScriptTransfer(v.caller, w, c)])
7272 }
7373
7474
7575
7676 @Callable(v)
7777 func claimReward () = u(v.caller)
7878
7979
8080
8181 @Callable(v)
8282 func topUpReward () = {
8383 let y = value(v.payments[0].assetId)
8484 let z = v.payments[0].amount
85- let w = if ((y == c))
85+ let w = if ((y == a))
8686 then 0
87- else if ((y == a))
87+ else if ((y == c))
8888 then z
8989 else throw("not correct asset attached")
9090 if ((w == w))
9191 then {
92- let p = f((("global_lastCheck_" + b) + "_interest"))
92+ let p = f((("global_lastCheck_" + d) + "_interest"))
9393 let x = f("global_staked")
9494 let A = if ((x > 0))
9595 then fraction(w, e, x)
9696 else 0
9797 if ((y != a))
98- then $Tuple2([IntegerEntry((("global_" + b) + "_earnings"), (f((("global_" + b) + "_earnings")) + w)), IntegerEntry((("global_lastCheck_" + b) + "_interest"), (p + A))], w)
98+ then $Tuple2([IntegerEntry((("global_" + d) + "_earnings"), (f((("global_" + d) + "_earnings")) + w)), IntegerEntry((("global_lastCheck_" + d) + "_interest"), (p + A))], w)
9999 else nil
100100 }
101101 else throw("Strict value is not equal to itself.")
102102 }
103103
104104
105105 @Verifier(B)
106106 func C () = sigVerify(B.bodyBytes, B.proofs[0], B.senderPublicKey)
107107

github/deemru/w8io/026f985 
32.00 ms