tx · GPhLQbfcy2motf11BbC2Z2eHwbRvD23Bu7HoNefLKbLQ 3MovRKHzcaxx3B5Tcb5KiLNiZ5gabqh13ZT: -0.00200000 Waves 2022.09.12 23:45 [2226393] smart account 3MovRKHzcaxx3B5Tcb5KiLNiZ5gabqh13ZT > SELF 0.00000000 Waves
{ "type": 13, "id": "GPhLQbfcy2motf11BbC2Z2eHwbRvD23Bu7HoNefLKbLQ", "fee": 200000, "feeAssetId": null, "timestamp": 1663015623411, "version": 2, "chainId": 84, "sender": "3MovRKHzcaxx3B5Tcb5KiLNiZ5gabqh13ZT", "senderPublicKey": "BuMZnGzFnTR4casvcVSFibwoXdtFMySvF3Y4RhtTh3gq", "proofs": [ "QB6L9Mkks3m4Ybex2fKjJ7zSPzrhgyeufQxvjCf7EcfDLvRQxED9qSW35rLXTw1ZdWEangsM2A8Y6y9yEBb1YJs" ], "script": "base64:BgIRCAISAwoBCBIAEgYKBAQCAQgGABhnbG9iYWxPbmJvYXJpbmdBbW91bnRLZXkCF2dsb2JhbF9vbmJvYXJkaW5nQW1vdW50ARNvbmJvYXJkaW5nU3RhdHVzS2V5AQZudW1iZXIJAKwCAgkArAICAgtvbmJvYXJkaW5nXwkApAMBBQZudW1iZXICB19zdGF0dXMBF3VzZXJPbmJvYXJkaW5nQW1vdW50S2V5AQR1c2VyCQCsAgIFBHVzZXICEV9vbmJvYXJkaW5nQW1vdW50ARF1c2VyT25ib2FyZGluZ0tleQIEdXNlcgZudW1iZXIJAKwCAgkArAICCQCsAgIJAKwCAgILb25ib2FyZGluZ18FBHVzZXICAV8JAKQDAQUGbnVtYmVyAgVfZGF0YQENdHJ5R2V0SW50ZWdlcgEDa2V5BAckbWF0Y2gwCQCaCAIFBHRoaXMFA2tleQMJAAECBQckbWF0Y2gwAgNJbnQEAXgFByRtYXRjaDAFAXgAAAEVY2FsY3VsYXRlU3Rha2VkQW1vdW50AQR1c2VyAJWa7zoDAWkBDWFkZE9uYm9hcmRpbmcBBHVzZXIEEHRv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cmdzBARib29sCmJ5dGVWZWN0b3IDaW50BnN0cmluZwkAzAgCCQELU3RyaW5nRW50cnkCAgVoZWxsbwIFd29ybGQFA25pbAC0L6JF", "height": 2226393, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6apFaqP2P8rBrXte2hPN1W4YabZpEgWTbxSVMCfaxDke Next: CTMNAAjhqwv4DB3BgGCDcxqSFPxWHAQKSbHbxeJquJou Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let globalOnboaringAmountKey = "global_onboardingAmount" | |
5 | + | ||
6 | + | func onboardingStatusKey (number) = (("onboarding_" + toString(number)) + "_status") | |
7 | + | ||
8 | + | ||
9 | + | func userOnboardingAmountKey (user) = (user + "_onboardingAmount") | |
10 | + | ||
11 | + | ||
12 | + | func userOnboardingKey (user,number) = (((("onboarding_" + user) + "_") + toString(number)) + "_data") | |
13 | + | ||
14 | + | ||
15 | + | func tryGetInteger (key) = match getInteger(this, key) { | |
16 | + | case x: Int => | |
17 | + | x | |
18 | + | case _ => | |
19 | + | 0 | |
20 | + | } | |
21 | + | ||
22 | + | ||
23 | + | func calculateStakedAmount (user) = 123456789 | |
24 | + | ||
25 | + | ||
26 | + | @Callable(i) | |
27 | + | func addOnboarding (user) = { | |
28 | + | let totalOnboardings = (tryGetInteger(globalOnboaringAmountKey) + 1) | |
29 | + | let userOnboarings = (tryGetInteger(userOnboardingAmountKey(user)) + 1) | |
30 | + | let userOnboarding = (("{\"startHeight\": 3291790, \"finishHeight\": 3307630, \"startAmount\": 25568667009, \"finishAmount\": 27199947964, \"premium\": 638, \"assetId\": \"WAVES\", \"globalNum\": " + toString(totalOnboardings)) + "}") | |
31 | + | [IntegerEntry(globalOnboaringAmountKey, totalOnboardings), StringEntry(onboardingStatusKey(totalOnboardings), "started"), IntegerEntry(userOnboardingAmountKey(user), userOnboarings), StringEntry(userOnboardingKey(user, userOnboarings), userOnboarding)] | |
32 | + | } | |
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | @Callable(i) | |
37 | + | func finishOnboarding () = { | |
38 | + | let totalOnboardings = tryGetInteger(globalOnboaringAmountKey) | |
39 | + | [StringEntry(onboardingStatusKey(totalOnboardings), "finished")] | |
40 | + | } | |
41 | + | ||
4 | 42 | ||
5 | 43 | ||
6 | 44 | @Callable(i) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let globalOnboaringAmountKey = "global_onboardingAmount" | |
5 | + | ||
6 | + | func onboardingStatusKey (number) = (("onboarding_" + toString(number)) + "_status") | |
7 | + | ||
8 | + | ||
9 | + | func userOnboardingAmountKey (user) = (user + "_onboardingAmount") | |
10 | + | ||
11 | + | ||
12 | + | func userOnboardingKey (user,number) = (((("onboarding_" + user) + "_") + toString(number)) + "_data") | |
13 | + | ||
14 | + | ||
15 | + | func tryGetInteger (key) = match getInteger(this, key) { | |
16 | + | case x: Int => | |
17 | + | x | |
18 | + | case _ => | |
19 | + | 0 | |
20 | + | } | |
21 | + | ||
22 | + | ||
23 | + | func calculateStakedAmount (user) = 123456789 | |
24 | + | ||
25 | + | ||
26 | + | @Callable(i) | |
27 | + | func addOnboarding (user) = { | |
28 | + | let totalOnboardings = (tryGetInteger(globalOnboaringAmountKey) + 1) | |
29 | + | let userOnboarings = (tryGetInteger(userOnboardingAmountKey(user)) + 1) | |
30 | + | let userOnboarding = (("{\"startHeight\": 3291790, \"finishHeight\": 3307630, \"startAmount\": 25568667009, \"finishAmount\": 27199947964, \"premium\": 638, \"assetId\": \"WAVES\", \"globalNum\": " + toString(totalOnboardings)) + "}") | |
31 | + | [IntegerEntry(globalOnboaringAmountKey, totalOnboardings), StringEntry(onboardingStatusKey(totalOnboardings), "started"), IntegerEntry(userOnboardingAmountKey(user), userOnboarings), StringEntry(userOnboardingKey(user, userOnboarings), userOnboarding)] | |
32 | + | } | |
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | @Callable(i) | |
37 | + | func finishOnboarding () = { | |
38 | + | let totalOnboardings = tryGetInteger(globalOnboaringAmountKey) | |
39 | + | [StringEntry(onboardingStatusKey(totalOnboardings), "finished")] | |
40 | + | } | |
41 | + | ||
4 | 42 | ||
5 | 43 | ||
6 | 44 | @Callable(i) | |
7 | 45 | func args (bool,byteVector,int,string) = [StringEntry("hello", "world")] | |
8 | 46 | ||
9 | 47 |
github/deemru/w8io/169f3d6 20.55 ms ◑