tx · GwWNB1rwifJaMufyxCAbEwwHRoALT87F91BVDVKj5GCT 3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB: -0.01400000 Waves 2021.06.04 04:49 [1554990] smart account 3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB > SELF 0.00000000 Waves
{ "type": 13, "id": "GwWNB1rwifJaMufyxCAbEwwHRoALT87F91BVDVKj5GCT", "fee": 1400000, "feeAssetId": null, "timestamp": 1622771388408, "version": 2, "chainId": 84, "sender": "3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB", "senderPublicKey": "CQ7vntBAYh2QZcKcqiiyEnQWWXsr98ysDptD23Wgxmvb", "proofs": [ "3nV9h583ttTtecJrmYY2tDVJCdsDyPSCrEbyquuzpgUnqwxwvVFeHTTc4zQjWAoPaS2g4dDELgb3oAM27MbqSww6" ], "script": "base64:AAIFAAAAAAAAAAoIAhIGCgQBAQEIAAAAAgAAAAAHaGFuZGlJZAEAAAAgmQAVX3L5MYxyaOxZ0FMoThkZR49kvwgxlwjo6C/iIRcBAAAAGWhhbmRpY2FwSW5kZXhSZXF1aXJlbWVudHMAAAABAAAAA251bQMJAABmAAAAAgUAAAADbnVtAAAAAAAAAAA2AAAAAAAAAAA2AwkAAGYAAAACAAAAAAAAAAAABQAAAANudW0AAAAAAAAAAAAFAAAAA251bQAAAAEAAAABaQEAAAAOcmVzdWx0SGFuZGljYXAAAAAEAAAAEnNjb3JlRGlmZmVyZW50aWFsMQAAABJzY29yZURpZmZlcmVudGlhbDIAAAASc2NvcmVEaWZmZXJlbnRpYWwzAAAACmN1cnJlbnRLZXkEAAAAF3Njb3JlRGlmZmVyZW50aWFsTG93ZXN0CQABlgAAAAEJAARMAAAAAgUAAAASc2NvcmVEaWZmZXJlbnRpYWwxCQAETAAAAAIFAAAAEnNjb3JlRGlmZmVyZW50aWFsMgkABEwAAAACBQAAABJzY29yZURpZmZlcmVudGlhbDMFAAAAA25pbAQAAAAGcmVzdWx0CQAAZQAAAAIFAAAAF3Njb3JlRGlmZmVyZW50aWFsTG93ZXN0AAAAAAAAAAACBAAAAA1oYW5kaWNhcEluZGV4CQEAAAAZaGFuZGljYXBJbmRleFJlcXVpcmVtZW50cwAAAAEFAAAABnJlc3VsdAkABRQAAAACCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIFAAAACmN1cnJlbnRLZXkCAAAADl9oYW5kaWNhcEluZGV4BQAAAA1oYW5kaWNhcEluZGV4CQAETAAAAAIJAQAAAAdSZWlzc3VlAAAAAwUAAAAHaGFuZGlJZAUAAAANaGFuZGljYXBJbmRleAcJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAA1oYW5kaWNhcEluZGV4BQAAAAdoYW5kaUlkBQAAAANuaWwFAAAADWhhbmRpY2FwSW5kZXgAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleXRZdcc=", "height": 1554990, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9E6Xd63K6Frp2JPTzrmVzMu3Yvp4UKxpgqS7HQUKEgh8 Next: 4JuAEq9idtYYXPpSW6uyhZhvFXJMk7iLYc9AGRsgVaQ7 Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | func listToStr (arr) = { | |
5 | - | func foldFunc (list,a) = (list :+ parseIntValue(a)) | |
4 | + | let handiId = base58'BJFTCAVHNhppygeLqYUyG5NB9GwNRjEjFeweJpXXi1DQ' | |
6 | 5 | ||
7 | - | let $list192218 = arr | |
8 | - | let $size192218 = size($list192218) | |
9 | - | let $acc0192218 = nil | |
10 | - | if (($size192218 == 0)) | |
11 | - | then $acc0192218 | |
12 | - | else { | |
13 | - | let $acc1192218 = foldFunc($acc0192218, $list192218[0]) | |
14 | - | if (($size192218 == 1)) | |
15 | - | then $acc1192218 | |
16 | - | else { | |
17 | - | let $acc2192218 = foldFunc($acc1192218, $list192218[1]) | |
18 | - | if (($size192218 == 2)) | |
19 | - | then $acc2192218 | |
20 | - | else { | |
21 | - | let $acc3192218 = foldFunc($acc2192218, $list192218[2]) | |
22 | - | if (($size192218 == 3)) | |
23 | - | then $acc3192218 | |
24 | - | else { | |
25 | - | let $acc4192218 = foldFunc($acc3192218, $list192218[3]) | |
26 | - | throw("List size exceed 3") | |
27 | - | } | |
28 | - | } | |
29 | - | } | |
30 | - | } | |
31 | - | } | |
6 | + | func handicapIndexRequirements (num) = if ((num > 54)) | |
7 | + | then 54 | |
8 | + | else if ((0 > num)) | |
9 | + | then 0 | |
10 | + | else num | |
32 | 11 | ||
33 | 12 | ||
34 | 13 | @Callable(i) | |
35 | - | func call () = { | |
36 | - | let count = 1 | |
37 | - | let strList = listToStr(["1", "2", "3"]) | |
38 | - | if ((count == 1)) | |
39 | - | then throw(("strList,0==>" + toString(strList[0]))) | |
40 | - | else [IntegerEntry("int", 1)] | |
14 | + | func resultHandicap (scoreDifferential1,scoreDifferential2,scoreDifferential3,currentKey) = { | |
15 | + | let scoreDifferentialLowest = max([scoreDifferential1, scoreDifferential2, scoreDifferential3]) | |
16 | + | let result = (scoreDifferentialLowest - 2) | |
17 | + | let handicapIndex = handicapIndexRequirements(result) | |
18 | + | $Tuple2([IntegerEntry((currentKey + "_handicapIndex"), handicapIndex), Reissue(handiId, handicapIndex, false), ScriptTransfer(i.caller, handicapIndex, handiId)], handicapIndex) | |
41 | 19 | } | |
42 | 20 | ||
43 | 21 |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | func listToStr (arr) = { | |
5 | - | func foldFunc (list,a) = (list :+ parseIntValue(a)) | |
4 | + | let handiId = base58'BJFTCAVHNhppygeLqYUyG5NB9GwNRjEjFeweJpXXi1DQ' | |
6 | 5 | ||
7 | - | let $list192218 = arr | |
8 | - | let $size192218 = size($list192218) | |
9 | - | let $acc0192218 = nil | |
10 | - | if (($size192218 == 0)) | |
11 | - | then $acc0192218 | |
12 | - | else { | |
13 | - | let $acc1192218 = foldFunc($acc0192218, $list192218[0]) | |
14 | - | if (($size192218 == 1)) | |
15 | - | then $acc1192218 | |
16 | - | else { | |
17 | - | let $acc2192218 = foldFunc($acc1192218, $list192218[1]) | |
18 | - | if (($size192218 == 2)) | |
19 | - | then $acc2192218 | |
20 | - | else { | |
21 | - | let $acc3192218 = foldFunc($acc2192218, $list192218[2]) | |
22 | - | if (($size192218 == 3)) | |
23 | - | then $acc3192218 | |
24 | - | else { | |
25 | - | let $acc4192218 = foldFunc($acc3192218, $list192218[3]) | |
26 | - | throw("List size exceed 3") | |
27 | - | } | |
28 | - | } | |
29 | - | } | |
30 | - | } | |
31 | - | } | |
6 | + | func handicapIndexRequirements (num) = if ((num > 54)) | |
7 | + | then 54 | |
8 | + | else if ((0 > num)) | |
9 | + | then 0 | |
10 | + | else num | |
32 | 11 | ||
33 | 12 | ||
34 | 13 | @Callable(i) | |
35 | - | func call () = { | |
36 | - | let count = 1 | |
37 | - | let strList = listToStr(["1", "2", "3"]) | |
38 | - | if ((count == 1)) | |
39 | - | then throw(("strList,0==>" + toString(strList[0]))) | |
40 | - | else [IntegerEntry("int", 1)] | |
14 | + | func resultHandicap (scoreDifferential1,scoreDifferential2,scoreDifferential3,currentKey) = { | |
15 | + | let scoreDifferentialLowest = max([scoreDifferential1, scoreDifferential2, scoreDifferential3]) | |
16 | + | let result = (scoreDifferentialLowest - 2) | |
17 | + | let handicapIndex = handicapIndexRequirements(result) | |
18 | + | $Tuple2([IntegerEntry((currentKey + "_handicapIndex"), handicapIndex), Reissue(handiId, handicapIndex, false), ScriptTransfer(i.caller, handicapIndex, handiId)], handicapIndex) | |
41 | 19 | } | |
42 | 20 | ||
43 | 21 | ||
44 | 22 | @Verifier(tx) | |
45 | 23 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
46 | 24 |
github/deemru/w8io/026f985 37.79 ms ◑