tx · AmoRKUo7aFbWtwaKs85ytz6kJ27svWnZDFdAUSdXojFS 3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB: -0.01400000 Waves 2021.06.04 05:19 [1555015] smart account 3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB > SELF 0.00000000 Waves
{ "type": 13, "id": "AmoRKUo7aFbWtwaKs85ytz6kJ27svWnZDFdAUSdXojFS", "fee": 1400000, "feeAssetId": null, "timestamp": 1622773178135, "version": 2, "chainId": 84, "sender": "3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB", "senderPublicKey": "CQ7vntBAYh2QZcKcqiiyEnQWWXsr98ysDptD23Wgxmvb", "proofs": [ "kiPcyPRfD5f9tt3Zbrp9dFy1xKENy4khGseF8boqX4ntNBeSGbG5D1mNsEZT5UUvESFxQZVR3fUZZCCzH9nLCPu" ], "script": "base64:AAIFAAAAAAAAAAoIAhIGCgQBAQEIAAAAAgAAAAAHaGFuZGlJZAEAAAAgmQAVX3L5MYxyaOxZ0FMoThkZR49kvwgxlwjo6C/iIRcBAAAAGWhhbmRpY2FwSW5kZXhSZXF1aXJlbWVudHMAAAABAAAAA251bQMJAABmAAAAAgUAAAADbnVtAAAAAAAAAAA2AAAAAAAAAAA2AwkAAGYAAAACAAAAAAAAAAAABQAAAANudW0AAAAAAAAAAAAFAAAAA251bQAAAAEAAAABaQEAAAAOcmVzdWx0SGFuZGljYXAAAAAEAAAAEnNjb3JlRGlmZmVyZW50aWFsMQAAABJzY29yZURpZmZlcmVudGlhbDIAAAASc2NvcmVEaWZmZXJlbnRpYWwzAAAACmN1cnJlbnRLZXkEAAAAF3Njb3JlRGlmZmVyZW50aWFsTG93ZXN0CQABlgAAAAEJAARMAAAAAgUAAAASc2NvcmVEaWZmZXJlbnRpYWwxCQAETAAAAAIFAAAAEnNjb3JlRGlmZmVyZW50aWFsMgkABEwAAAACBQAAABJzY29yZURpZmZlcmVudGlhbDMFAAAAA25pbAQAAAAGcmVzdWx0CQAAZQAAAAIFAAAAF3Njb3JlRGlmZmVyZW50aWFsTG93ZXN0AAAAAAAAAAACBAAAAA1oYW5kaWNhcEluZGV4CQEAAAAZaGFuZGljYXBJbmRleFJlcXVpcmVtZW50cwAAAAEFAAAABnJlc3VsdAkABRQAAAACCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIFAAAACmN1cnJlbnRLZXkCAAAADl9oYW5kaWNhcEluZGV4BQAAAA1oYW5kaWNhcEluZGV4CQAETAAAAAIJAQAAAAdSZWlzc3VlAAAAAwUAAAAHaGFuZGlJZAUAAAANaGFuZGljYXBJbmRleAcJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAA1oYW5kaWNhcEluZGV4BQAAAAdoYW5kaUlkBQAAAANuaWwFAAAADWhhbmRpY2FwSW5kZXgAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleXRZdcc=", "height": 1555015, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4JuAEq9idtYYXPpSW6uyhZhvFXJMk7iLYc9AGRsgVaQ7 Next: DqAVC4qKtFn4yVGuxbjoP2eeeatmkRS2DTiJDZ86cAsm Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let handiId = base58'BJFTCAVHNhppygeLqYUyG5NB9GwNRjEjFeweJpXXi1DQ' | |
5 | 5 | ||
6 | - | func getRandomNumber (variants,txId,hatchingFinishHeight,offset) = { | |
7 | - | let randomSeedBlock = value(blockInfoByHeight((hatchingFinishHeight - 1))) | |
8 | - | let randomHash = sha256((txId + value(randomSeedBlock.vrf))) | |
9 | - | (toInt(randomHash, (offset * 8)) % variants) | |
10 | - | } | |
11 | - | ||
12 | - | ||
13 | - | func generation (num) = if (if ((num > 0)) | |
14 | - | then true | |
15 | - | else (300 >= num)) | |
16 | - | then "G1" | |
17 | - | else if (if ((num > 300)) | |
18 | - | then true | |
19 | - | else (1000 >= num)) | |
20 | - | then "G2" | |
21 | - | else "G3" | |
22 | - | ||
23 | - | ||
24 | - | func geneCode (num) = if ((num == 100)) | |
25 | - | then "II-II-II-II" | |
26 | - | else if (if ((num >= 1)) | |
27 | - | then (3 >= num) | |
28 | - | else false) | |
29 | - | then "BB-BB-BB-BB" | |
30 | - | else if (if ((num > 3)) | |
31 | - | then (8 >= num) | |
32 | - | else false) | |
33 | - | then "CC-CC-CC-CC" | |
34 | - | else if (if ((num > 8)) | |
35 | - | then (15 >= num) | |
36 | - | else false) | |
37 | - | then "DD-DD-DD-DD" | |
38 | - | else if (if ((num > 15)) | |
39 | - | then (24 >= num) | |
40 | - | else false) | |
41 | - | then "EE-EE-EE-EE" | |
42 | - | else if (if ((num > 24)) | |
43 | - | then (35 >= num) | |
44 | - | else false) | |
45 | - | then "FF-FF-FF-FF" | |
46 | - | else if (if ((num > 35)) | |
47 | - | then (48 >= num) | |
48 | - | else false) | |
49 | - | then "GG-GG-GG-GG" | |
50 | - | else if (if ((num > 48)) | |
51 | - | then (51 >= num) | |
52 | - | else false) | |
53 | - | then "AA-AA-AA-AA" | |
54 | - | else "HH-HH-HH-HH" | |
6 | + | func handicapIndexRequirements (num) = if ((num > 54)) | |
7 | + | then 54 | |
8 | + | else if ((0 > num)) | |
9 | + | then 0 | |
10 | + | else num | |
55 | 11 | ||
56 | 12 | ||
57 | 13 | @Callable(i) | |
58 | - | func giveBirthKitten () = { | |
59 | - | let pmt = i.payments[0] | |
60 | - | let pmtId = toBase58String(value(pmt.assetId)) | |
61 | - | if ((pmtId != kittenId)) | |
62 | - | then throw("Please send Kitten token.") | |
63 | - | else { | |
64 | - | let kittenAmount = pmt.amount | |
65 | - | if ((kittenAmount > 300)) | |
66 | - | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
67 | - | else if ((300 > kittenAmount)) | |
68 | - | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
69 | - | else { | |
70 | - | let issueQuantity = match getInteger(this, "issueQuantity") { | |
71 | - | case a: Int => | |
72 | - | a | |
73 | - | case _ => | |
74 | - | 0 | |
75 | - | } | |
76 | - | let newQuantity = (issueQuantity + 1) | |
77 | - | let generationType = generation(newQuantity) | |
78 | - | let issueNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false) | |
79 | - | let issueNftId = calculateAssetId(issueNft) | |
80 | - | let blockHeight = lastBlock.height | |
81 | - | let typeRandom = getRandomNumber(100, issueNftId, blockHeight, 0) | |
82 | - | let genetype = geneCode(typeRandom) | |
83 | - | [issueNft, ScriptTransfer(i.caller, 1, issueNftId), StringEntry(toBase58String(value(issueNftId)), genetype), IntegerEntry("issueQuantity", newQuantity)] | |
84 | - | } | |
85 | - | } | |
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) | |
86 | 19 | } | |
87 | 20 | ||
88 | 21 |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let handiId = base58'BJFTCAVHNhppygeLqYUyG5NB9GwNRjEjFeweJpXXi1DQ' | |
5 | 5 | ||
6 | - | func getRandomNumber (variants,txId,hatchingFinishHeight,offset) = { | |
7 | - | let randomSeedBlock = value(blockInfoByHeight((hatchingFinishHeight - 1))) | |
8 | - | let randomHash = sha256((txId + value(randomSeedBlock.vrf))) | |
9 | - | (toInt(randomHash, (offset * 8)) % variants) | |
10 | - | } | |
11 | - | ||
12 | - | ||
13 | - | func generation (num) = if (if ((num > 0)) | |
14 | - | then true | |
15 | - | else (300 >= num)) | |
16 | - | then "G1" | |
17 | - | else if (if ((num > 300)) | |
18 | - | then true | |
19 | - | else (1000 >= num)) | |
20 | - | then "G2" | |
21 | - | else "G3" | |
22 | - | ||
23 | - | ||
24 | - | func geneCode (num) = if ((num == 100)) | |
25 | - | then "II-II-II-II" | |
26 | - | else if (if ((num >= 1)) | |
27 | - | then (3 >= num) | |
28 | - | else false) | |
29 | - | then "BB-BB-BB-BB" | |
30 | - | else if (if ((num > 3)) | |
31 | - | then (8 >= num) | |
32 | - | else false) | |
33 | - | then "CC-CC-CC-CC" | |
34 | - | else if (if ((num > 8)) | |
35 | - | then (15 >= num) | |
36 | - | else false) | |
37 | - | then "DD-DD-DD-DD" | |
38 | - | else if (if ((num > 15)) | |
39 | - | then (24 >= num) | |
40 | - | else false) | |
41 | - | then "EE-EE-EE-EE" | |
42 | - | else if (if ((num > 24)) | |
43 | - | then (35 >= num) | |
44 | - | else false) | |
45 | - | then "FF-FF-FF-FF" | |
46 | - | else if (if ((num > 35)) | |
47 | - | then (48 >= num) | |
48 | - | else false) | |
49 | - | then "GG-GG-GG-GG" | |
50 | - | else if (if ((num > 48)) | |
51 | - | then (51 >= num) | |
52 | - | else false) | |
53 | - | then "AA-AA-AA-AA" | |
54 | - | else "HH-HH-HH-HH" | |
6 | + | func handicapIndexRequirements (num) = if ((num > 54)) | |
7 | + | then 54 | |
8 | + | else if ((0 > num)) | |
9 | + | then 0 | |
10 | + | else num | |
55 | 11 | ||
56 | 12 | ||
57 | 13 | @Callable(i) | |
58 | - | func giveBirthKitten () = { | |
59 | - | let pmt = i.payments[0] | |
60 | - | let pmtId = toBase58String(value(pmt.assetId)) | |
61 | - | if ((pmtId != kittenId)) | |
62 | - | then throw("Please send Kitten token.") | |
63 | - | else { | |
64 | - | let kittenAmount = pmt.amount | |
65 | - | if ((kittenAmount > 300)) | |
66 | - | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
67 | - | else if ((300 > kittenAmount)) | |
68 | - | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
69 | - | else { | |
70 | - | let issueQuantity = match getInteger(this, "issueQuantity") { | |
71 | - | case a: Int => | |
72 | - | a | |
73 | - | case _ => | |
74 | - | 0 | |
75 | - | } | |
76 | - | let newQuantity = (issueQuantity + 1) | |
77 | - | let generationType = generation(newQuantity) | |
78 | - | let issueNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false) | |
79 | - | let issueNftId = calculateAssetId(issueNft) | |
80 | - | let blockHeight = lastBlock.height | |
81 | - | let typeRandom = getRandomNumber(100, issueNftId, blockHeight, 0) | |
82 | - | let genetype = geneCode(typeRandom) | |
83 | - | [issueNft, ScriptTransfer(i.caller, 1, issueNftId), StringEntry(toBase58String(value(issueNftId)), genetype), IntegerEntry("issueQuantity", newQuantity)] | |
84 | - | } | |
85 | - | } | |
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) | |
86 | 19 | } | |
87 | 20 | ||
88 | 21 | ||
89 | 22 | @Verifier(tx) | |
90 | 23 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
91 | 24 |
github/deemru/w8io/026f985 45.11 ms ◑