tx · 3p2Dw2wsrYh9aCkyDs5tdQixPXADneubkiwvzbQWhJWh

3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB:  -0.01000000 Waves

2023.09.22 22:19 [2767007] smart account 3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB > SELF 0.00000000 Waves

{ "type": 13, "id": "3p2Dw2wsrYh9aCkyDs5tdQixPXADneubkiwvzbQWhJWh", "fee": 1000000, "feeAssetId": null, "timestamp": 1695410458924, "version": 2, "chainId": 84, "sender": "3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB", "senderPublicKey": "8M2WuphuhMvTZMcpBocfLqUvkcFJisjdcCZaaPHxpwmS", "proofs": [ "W89ovyvc7YbBJ8JPUfCWYYYfRbvoozvUbi98XvvBmFa93T9qyoPk4g3L4eQWWeUwS7MC8uXBy3oeZX3QLsxzTXz" ], "script": "base64:BgLRAggCEgASAwoBARIAEgAiBnVzZG5JZCIJdXNkbklkU3RyIghwdXp6bGVJZCILcHV6emxlSWRTdHIiBVNjYWxlIg10cnlHZXRJbnRlZ2VyIgNrZXkiByRtYXRjaDAiAWIiDHRyeUdldFN0cmluZyIBYSIQY2xhaW1BbGlhc1Jlc3VsdCIHYWRkcmVzcyIKYXNzZXRJZFN0ciIKYWRkcmVzc1N0ciIPY3VycmVudEludGVyZXN0IgxzdGFrZWRBbW91bnQiGGxhc3RDaGVja0ludGVyZXN0SW5TdGF0ZSIRbGFzdENoZWNrSW50ZXJlc3QiBnJld2FyZCILY2xhaW1SZXN1bHQiAWkiBmFtb3VudCIRdG90YWxTdGFrZWRBbW91bnQiCHBtdEFzc2V0IglwbXRBbW91bnQiDWludGVyZXN0RGVsdGEiAnR4IgZ2ZXJpZnkJAAFhASBvJKPKqzDcUimY6CxhWu5afyNNwi11u+mdqlTg0tAHwQABYgIsOFVyZkRWZDVHcmVlVXdtN3VQazdlWXoxZU12Mzc2a3pSNTJDNnNBTlBrd1MAAWMBIGEgR2q15TSU04z5reN5xPpwlT3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JAKwCAgkArAICAhFnbG9iYWxfbGFzdENoZWNrXwUBYgIJX2ludGVyZXN0CQBkAgUBcAUBQQUDbmlsBQF3BQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAUIBAUMACQD0AwMIBQFCCWJvZHlCeXRlcwkAkQMCCAUBQgZwcm9vZnMAAAgFAUIPc2VuZGVyUHVibGljS2V5DyWp3A==", "height": 2767007, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4QFAe2oPYS4e4Z4KN2gWsbDFj4nLc9XwtAxxhqaHim9h Next: 7i3uFq7Zwa4QR3nt8AAYj4KQXAHRivDERUSHzUqSkjH2 Diff:
OldNewDifferences
8989 else throw("not correct asset attached")
9090 if ((w == w))
9191 then {
92- let p = f((("global_lastCheck_" + d) + "_interest"))
92+ let p = f((("global_lastCheck_" + b) + "_interest"))
9393 let x = f("global_staked")
9494 let A = if ((x > 0))
9595 then fraction(w, e, x)
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)
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
8585 let w = if ((y == a))
8686 then 0
8787 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_" + d) + "_interest"))
92+ let p = f((("global_lastCheck_" + b) + "_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))
9898 then $Tuple2([IntegerEntry((("global_" + b) + "_earnings"), (f((("global_" + b) + "_earnings")) + w)), IntegerEntry((("global_lastCheck_" + b) + "_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 
24.57 ms