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:BgIVCAISABIAEgASAwoBARIGCgQEAgEICAAYZ2xvYmFsT25ib2FyaW5nQW1vdW50S2V5AhdnbG9iYWxfb25ib2FyZGluZ0Ftb3VudAETb25ib2FyZGluZ1N0YXR1c0tleQEGbnVtYmVyCQCsAgIJAKwCAgILb25ib2FyZGluZ18JAKQDAQUGbnVtYmVyAgdfc3RhdHVzARd1c2VyT25ib2FyZGluZ0Ftb3VudEtleQEEdXNlcgkArAICBQR1c2VyAhFfb25ib2FyZGluZ0Ftb3VudAERdXNlck9uYm9hcmRpbmdLZXkCBHVzZXIGbnVtYmVyCQCsAgIJAKwCAgkArAICCQCsAgICC29uYm9hcmRpbmdfBQR1c2VyAgFfCQCkAwEFBm51bWJlcgIFX2RhdGEBEnZpcmVzVXNlckhlYWx0aEtleQEEdXNlcgkArAICAgx2aXJlc0hlYWx0aF8FBHVzZXIBDXRyeUdldEludGVnZXIBA2tleQQHJG1hdGNoMAkAmggCBQR0aGlzBQNrZXkDCQABAgUHJG1hdGNoMAIDSW50BAF4BQckbWF0Y2gwBQF4AAABFWNhbGN1bGF0ZVN0YWtlZEFt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QEMSW50ZWdlckVudHJ5AgUYZ2xvYmFsT25ib2FyaW5nQW1vdW50S2V5BRB0b3RhbE9uYm9hcmRpbmdzCQDMCAIJAQtTdHJpbmdFbnRyeQIJARNvbmJvYXJkaW5nU3RhdHVzS2V5AQUQdG90YWxPbmJvYXJkaW5ncwIHc3RhcnRlZAkAzAgCCQEMSW50ZWdlckVudHJ5AgkBF3VzZXJPbmJvYXJkaW5nQW1vdW50S2V5AQUEdXNlcgUOdXNlck9uYm9hcmluZ3MJAMwIAgkBC1N0cmluZ0VudHJ5AgkBEXVzZXJPbmJvYXJkaW5nS2V5AgUEdXNlcgUOdXNlck9uYm9hcmluZ3MFDnVzZXJPbmJvYXJkaW5nBQNuaWwBaQEQZmluaXNoT25ib2FyZGluZwEGbnVtYmVyCQDMCAIJAQtTdHJpbmdFbnRyeQIJARNvbmJvYXJkaW5nU3RhdHVzS2V5AQUGbnVtYmVyAghmaW5pc2hlZAUDbmlsAWkBBGFyZ3MEBGJvb2wKYnl0ZVZlY3RvcgNpbnQGc3RyaW5nCQDMCAIJAQtTdHJpbmdFbnRyeQICBWhlbGxvAgV3b3JsZAUDbmlsAB4L7Ro=", "height": 2227744, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CTMNAAjhqwv4DB3BgGCDcxqSFPxWHAQKSbHbxeJquJou Next: none Diff:
OldNewDifferences
1212 func userOnboardingKey (user,number) = (((("onboarding_" + user) + "_") + toString(number)) + "_data")
1313
1414
15+func viresUserHealthKey (user) = ("viresHealth_" + user)
16+
17+
1518 func tryGetInteger (key) = match getInteger(this, key) {
1619 case x: Int =>
1720 x
2124
2225
2326 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+
2453
2554
2655 @Callable(i)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let globalOnboaringAmountKey = "global_onboardingAmount"
55
66 func onboardingStatusKey (number) = (("onboarding_" + toString(number)) + "_status")
77
88
99 func userOnboardingAmountKey (user) = (user + "_onboardingAmount")
1010
1111
1212 func userOnboardingKey (user,number) = (((("onboarding_" + user) + "_") + toString(number)) + "_data")
1313
1414
15+func viresUserHealthKey (user) = ("viresHealth_" + user)
16+
17+
1518 func tryGetInteger (key) = match getInteger(this, key) {
1619 case x: Int =>
1720 x
1821 case _ =>
1922 0
2023 }
2124
2225
2326 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+
2453
2554
2655 @Callable(i)
2756 func addOnboarding () = {
2857 let user = toString(i.caller)
2958 let totalOnboardings = (tryGetInteger(globalOnboaringAmountKey) + 1)
3059 let userOnboarings = (tryGetInteger(userOnboardingAmountKey(user)) + 1)
3160 let userOnboarding = (("{\"startHeight\": 3291790, \"finishHeight\": 3307630, \"startAmount\": 25568667009, \"finishAmount\": 27199947964, \"premium\": 638, \"assetId\": \"WAVES\", \"globalNum\": " + toString(totalOnboardings)) + "}")
3261 [IntegerEntry(globalOnboaringAmountKey, totalOnboardings), StringEntry(onboardingStatusKey(totalOnboardings), "started"), IntegerEntry(userOnboardingAmountKey(user), userOnboarings), StringEntry(userOnboardingKey(user, userOnboarings), userOnboarding)]
3362 }
3463
3564
3665
3766 @Callable(i)
3867 func finishOnboarding (number) = [StringEntry(onboardingStatusKey(number), "finished")]
3968
4069
4170
4271 @Callable(i)
4372 func args (bool,byteVector,int,string) = [StringEntry("hello", "world")]
4473
4574

github/deemru/w8io/169f3d6 
34.96 ms