tx · pytV4bVnNbkQec51rSUc4HXdLWR36G1rcZaqCBm7Q1G 3MovRKHzcaxx3B5Tcb5KiLNiZ5gabqh13ZT: -0.00200000 Waves 2022.09.13 22:29 [2227744] smart account 3MovRKHzcaxx3B5Tcb5KiLNiZ5gabqh13ZT > SELF 0.00000000 Waves
{ "type": 13, "id": "pytV4bVnNbkQec51rSUc4HXdLWR36G1rcZaqCBm7Q1G", "fee": 200000, "feeAssetId": null, "timestamp": 1663097422588, "version": 2, "chainId": 84, "sender": "3MovRKHzcaxx3B5Tcb5KiLNiZ5gabqh13ZT", "senderPublicKey": "BuMZnGzFnTR4casvcVSFibwoXdtFMySvF3Y4RhtTh3gq", "proofs": [ "67GsL1RQHw9VqhoqotLKu7qt3193CCv8BxMmT8b6Bz6LSUB73pf3hFduN1xEqVdnKxmDL54YbyPvWj4qpzFWX9ug" ], "script": "base64:BgIVCAISABIAEgASAwoBARIGCgQEAgEICAAYZ2xvYmFsT25ib2FyaW5nQW1vdW50S2V5AhdnbG9iYWxfb25ib2FyZGluZ0Ftb3VudAETb25ib2FyZGluZ1N0YXR1c0tleQEGbnVtYmVyCQCsAgIJAKwCAgILb25ib2FyZGluZ18JAKQDAQUGbnVtYmVyAgdfc3RhdHVzARd1c2VyT25ib2FyZGluZ0Ftb3VudEtleQEEdXNlcgkArAICBQR1c2VyAhFfb25ib2FyZGluZ0Ftb3VudAERdXNlck9uYm9hcmRpbmdLZXkCBHVzZXIGbnVtYmVyCQCsAgIJAKwCAgkArAICCQCsAgICC29uYm9hcmRpbmdfBQR1c2VyAgFfCQCkAwEFBm51bWJlcgIFX2RhdGEBEnZpcmVzVXNlckhlYWx0aEtleQEEdXNlcgkArAICAgx2aXJlc0hlYWx0aF8FBHVzZXIBDXRyeUdldEludGVnZXIBA2tleQQHJG1hdGNoMAkAmggCBQR0aGlzBQNrZXkDCQABAgUHJG1hdGNoMAIDSW50BAF4BQckbWF0Y2gwBQF4AAABFWNhbGN1bGF0ZVN0YWtlZEFtb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EMSW50ZWdlckVudHJ5AgUYZ2xvYmFsT25ib2FyaW5nQW1vdW50S2V5BRB0b3RhbE9uYm9hcmRpbmdzCQDMCAIJAQtTdHJpbmdFbnRyeQIJARNvbmJvYXJkaW5nU3RhdHVzS2V5AQUQdG90YWxPbmJvYXJkaW5ncwIHc3RhcnRlZAkAzAgCCQEMSW50ZWdlckVudHJ5AgkBF3VzZXJPbmJvYXJkaW5nQW1vdW50S2V5AQUEdXNlcgUOdXNlck9uYm9hcmluZ3MJAMwIAgkBC1N0cmluZ0VudHJ5AgkBEXVzZXJPbmJvYXJkaW5nS2V5AgUEdXNlcgUOdXNlck9uYm9hcmluZ3MFDnVzZXJPbmJvYXJkaW5nBQNuaWwBaQEQZmluaXNoT25ib2FyZGluZwEGbnVtYmVyCQDMCAIJAQtTdHJpbmdFbnRyeQIJARNvbmJvYXJkaW5nU3RhdHVzS2V5AQUGbnVtYmVyAghmaW5pc2hlZAUDbmlsAWkBBGFyZ3MEBGJvb2wKYnl0ZVZlY3RvcgNpbnQGc3RyaW5nCQDMCAIJAQtTdHJpbmdFbnRyeQICBWhlbGxvAgV3b3JsZAUDbmlsAB4L7Ro=", "height": 2227744, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CTMNAAjhqwv4DB3BgGCDcxqSFPxWHAQKSbHbxeJquJou Next: none Diff:
Old | New | Differences | |
---|---|---|---|
12 | 12 | func userOnboardingKey (user,number) = (((("onboarding_" + user) + "_") + toString(number)) + "_data") | |
13 | 13 | ||
14 | 14 | ||
15 | + | func viresUserHealthKey (user) = ("viresHealth_" + user) | |
16 | + | ||
17 | + | ||
15 | 18 | func tryGetInteger (key) = match getInteger(this, key) { | |
16 | 19 | case x: Int => | |
17 | 20 | x | |
21 | 24 | ||
22 | 25 | ||
23 | 26 | func calculateStakedAmount (user) = 123456789 | |
27 | + | ||
28 | + | ||
29 | + | func getUserHealth (user) = match getString(this, viresUserHealthKey(user)) { | |
30 | + | case x: String => | |
31 | + | x | |
32 | + | case _ => | |
33 | + | "bp:0, bpu:0" | |
34 | + | } | |
35 | + | ||
36 | + | ||
37 | + | @Callable(i) | |
38 | + | func setHighHealth () = { | |
39 | + | let user = toString(i.caller) | |
40 | + | let key = viresUserHealthKey(user) | |
41 | + | [StringEntry(key, "bp:31063376953, bpu:9599925127")] | |
42 | + | } | |
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | @Callable(i) | |
47 | + | func setLowHealth () = { | |
48 | + | let user = toString(i.caller) | |
49 | + | let key = viresUserHealthKey(user) | |
50 | + | [StringEntry(key, "bp:9906337695, bpu:9599925127")] | |
51 | + | } | |
52 | + | ||
24 | 53 | ||
25 | 54 | ||
26 | 55 | @Callable(i) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let globalOnboaringAmountKey = "global_onboardingAmount" | |
5 | 5 | ||
6 | 6 | func onboardingStatusKey (number) = (("onboarding_" + toString(number)) + "_status") | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func userOnboardingAmountKey (user) = (user + "_onboardingAmount") | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func userOnboardingKey (user,number) = (((("onboarding_" + user) + "_") + toString(number)) + "_data") | |
13 | 13 | ||
14 | 14 | ||
15 | + | func viresUserHealthKey (user) = ("viresHealth_" + user) | |
16 | + | ||
17 | + | ||
15 | 18 | func tryGetInteger (key) = match getInteger(this, key) { | |
16 | 19 | case x: Int => | |
17 | 20 | x | |
18 | 21 | case _ => | |
19 | 22 | 0 | |
20 | 23 | } | |
21 | 24 | ||
22 | 25 | ||
23 | 26 | func calculateStakedAmount (user) = 123456789 | |
27 | + | ||
28 | + | ||
29 | + | func getUserHealth (user) = match getString(this, viresUserHealthKey(user)) { | |
30 | + | case x: String => | |
31 | + | x | |
32 | + | case _ => | |
33 | + | "bp:0, bpu:0" | |
34 | + | } | |
35 | + | ||
36 | + | ||
37 | + | @Callable(i) | |
38 | + | func setHighHealth () = { | |
39 | + | let user = toString(i.caller) | |
40 | + | let key = viresUserHealthKey(user) | |
41 | + | [StringEntry(key, "bp:31063376953, bpu:9599925127")] | |
42 | + | } | |
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | @Callable(i) | |
47 | + | func setLowHealth () = { | |
48 | + | let user = toString(i.caller) | |
49 | + | let key = viresUserHealthKey(user) | |
50 | + | [StringEntry(key, "bp:9906337695, bpu:9599925127")] | |
51 | + | } | |
52 | + | ||
24 | 53 | ||
25 | 54 | ||
26 | 55 | @Callable(i) | |
27 | 56 | func addOnboarding () = { | |
28 | 57 | let user = toString(i.caller) | |
29 | 58 | let totalOnboardings = (tryGetInteger(globalOnboaringAmountKey) + 1) | |
30 | 59 | let userOnboarings = (tryGetInteger(userOnboardingAmountKey(user)) + 1) | |
31 | 60 | let userOnboarding = (("{\"startHeight\": 3291790, \"finishHeight\": 3307630, \"startAmount\": 25568667009, \"finishAmount\": 27199947964, \"premium\": 638, \"assetId\": \"WAVES\", \"globalNum\": " + toString(totalOnboardings)) + "}") | |
32 | 61 | [IntegerEntry(globalOnboaringAmountKey, totalOnboardings), StringEntry(onboardingStatusKey(totalOnboardings), "started"), IntegerEntry(userOnboardingAmountKey(user), userOnboarings), StringEntry(userOnboardingKey(user, userOnboarings), userOnboarding)] | |
33 | 62 | } | |
34 | 63 | ||
35 | 64 | ||
36 | 65 | ||
37 | 66 | @Callable(i) | |
38 | 67 | func finishOnboarding (number) = [StringEntry(onboardingStatusKey(number), "finished")] | |
39 | 68 | ||
40 | 69 | ||
41 | 70 | ||
42 | 71 | @Callable(i) | |
43 | 72 | func args (bool,byteVector,int,string) = [StringEntry("hello", "world")] | |
44 | 73 | ||
45 | 74 |
github/deemru/w8io/169f3d6 34.96 ms ◑