tx · DSdMaVasgRi8PCoaaq2ri7xwsWEjn81ztJjfdxVez3gY

3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB:  -0.01000000 Waves

2023.09.22 21:04 [2766923] smart account 3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB > SELF 0.00000000 Waves

{ "type": 13, "id": "DSdMaVasgRi8PCoaaq2ri7xwsWEjn81ztJjfdxVez3gY", "fee": 1000000, "feeAssetId": null, "timestamp": 1695405918858, "version": 2, "chainId": 84, "sender": "3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB", "senderPublicKey": "8M2WuphuhMvTZMcpBocfLqUvkcFJisjdcCZaaPHxpwmS", "proofs": [ "2XmZWg4FBbnKTo5XxYzYnKJkQi2hSDC7WZcNGbtH4EorQuMPh3nN39qDkNsUKfKA9nvVE4vum8YUr6qkUjta83n7" ], "script": "base64:BgLAAggCEgASAwoBARIAEgAiBnVzZG5JZCIJdXNkbklkU3RyIghwdXp6bGVJZCILcHV6emxlSWRTdHIiBVNjYWxlIg10cnlHZXRJbnRlZ2VyIgNrZXkiByRtYXRjaDAiAWIiEGNsYWltQWxpYXNSZXN1bHQiB2FkZHJlc3MiCmFzc2V0SWRTdHIiCmFkZHJlc3NTdHIiD2N1cnJlbnRJbnRlcmVzdCIMc3Rha2VkQW1vdW50IhhsYXN0Q2hlY2tJbnRlcmVzdEluU3RhdGUiEWxhc3RDaGVja0ludGVyZXN0IgZyZXdhcmQiC2NsYWltUmVzdWx0IgFpIgZhbW91bnQiEXRvdGFsU3Rha2VkQW1vdW50IghwbXRBc3NldCIJcG10QW1vdW50Ig1pbnRlcmVzdERlbHRhIgJ0eCIGdmVyaWZ5CAABYQEgbySjyqsw3FIpmOgsYVruWn8jTcItdbvpnapU4NLQB8EAAWICLDhVcmZEVmQ1R3JlZVV3bTd1UGs3ZVl6MWVNdjM3Nmt6UjUyQzZzQU5Qa3dTAAFjASBhIEdqteU0lNOM+a3jecT6cJU92ajDMxppPdJKJ6I3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aWwFAXUJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAXoBAUEACQD0AwMIBQF6CWJvZHlCeXRlcwkAkQMCCAUBegZwcm9vZnMAAAgFAXoPc2VuZGVyUHVibGljS2V56Ta5Sg==", "height": 2766923, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FNpyEmdbhsfxaghg8FrLSBSruzAQmXWSDukqbmmNSKGw Next: 7KoKHebjbi7Sr441at7eCZRdJPqn2yJ9jhpet6wR4TNm Diff:
OldNewDifferences
8383 let y = if ((v > 0))
8484 then fraction(u, e, v)
8585 else 0
86- if ((w != a))
87- then $Tuple2([IntegerEntry((("global_" + d) + "_earnings"), (f((("global_" + d) + "_earnings")) + u)), IntegerEntry((("global_lastCheck_" + d) + "_interest"), (n + y))], u)
88- else nil
86+ $Tuple2([IntegerEntry((("global_" + d) + "_earnings"), (f((("global_" + d) + "_earnings")) + u)), IntegerEntry((("global_lastCheck_" + d) + "_interest"), (n + y))], u)
8987 }
9088 else throw("Strict value is not equal to itself.")
9189 }
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 (k,l) = {
2626 let m = toString(k)
2727 let n = f((("global_lastCheck_" + l) + "_interest"))
2828 let o = f((m + "_staked"))
2929 let p = f((((m + "_lastCheck_") + l) + "_interest"))
3030 let q = if ((p == 0))
3131 then 0
3232 else p
3333 let r = fraction((n - q), o, e)
3434 [IntegerEntry((((m + "_lastCheck_") + l) + "_interest"), n), IntegerEntry((((m + "_") + l) + "_claimed"), (f((((m + "_") + l) + "_claimed")) + r)), ScriptTransfer(k, r, fromBase58String(l))]
3535 }
3636
3737
3838 func s (k) = (j(k, b) ++ j(k, d))
3939
4040
4141 @Callable(t)
4242 func stake () = {
4343 let u = t.payments[0].amount
4444 let m = toString(t.caller)
4545 let l = toBase58String(a)
4646 let v = f("global_staked")
4747 if ((t.payments[0].assetId != c))
4848 then throw("wrong asset attached")
4949 else (s(t.caller) ++ [IntegerEntry("global_staked", (v + u)), IntegerEntry((m + "_staked"), (f((m + "_staked")) + u))])
5050 }
5151
5252
5353
5454 @Callable(t)
5555 func unStake (u) = {
5656 let m = toString(t.caller)
5757 let o = f((m + "_staked"))
5858 if ((u > o))
5959 then throw("you don't have tokens available")
6060 else (s(t.caller) ++ [IntegerEntry((m + "_staked"), (o - u)), IntegerEntry("global_staked", (f("global_staked") - u)), ScriptTransfer(t.caller, u, c)])
6161 }
6262
6363
6464
6565 @Callable(t)
6666 func claimReward () = s(t.caller)
6767
6868
6969
7070 @Callable(t)
7171 func topUpReward () = {
7272 let w = value(t.payments[0].assetId)
7373 let x = t.payments[0].amount
7474 let u = if ((w == a))
7575 then 0
7676 else if ((w == c))
7777 then x
7878 else throw("not correct asset attached")
7979 if ((u == u))
8080 then {
8181 let n = f((("global_lastCheck_" + d) + "_interest"))
8282 let v = f("global_staked")
8383 let y = if ((v > 0))
8484 then fraction(u, e, v)
8585 else 0
86- if ((w != a))
87- then $Tuple2([IntegerEntry((("global_" + d) + "_earnings"), (f((("global_" + d) + "_earnings")) + u)), IntegerEntry((("global_lastCheck_" + d) + "_interest"), (n + y))], u)
88- else nil
86+ $Tuple2([IntegerEntry((("global_" + d) + "_earnings"), (f((("global_" + d) + "_earnings")) + u)), IntegerEntry((("global_lastCheck_" + d) + "_interest"), (n + y))], u)
8987 }
9088 else throw("Strict value is not equal to itself.")
9189 }
9290
9391
9492 @Verifier(z)
9593 func A () = sigVerify(z.bodyBytes, z.proofs[0], z.senderPublicKey)
9694

github/deemru/w8io/169f3d6 
39.24 ms