tx · GEQ7huav6U5Er4HAhMuy7onYhJMWxQMZaAj3uqFAEMQC 3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB: -0.01400000 Waves 2021.05.30 18:29 [1548588] smart account 3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB > SELF 0.00000000 Waves
{ "type": 13, "id": "GEQ7huav6U5Er4HAhMuy7onYhJMWxQMZaAj3uqFAEMQC", "fee": 1400000, "feeAssetId": null, "timestamp": 1622388589268, "version": 2, "chainId": 84, "sender": "3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB", "senderPublicKey": "CQ7vntBAYh2QZcKcqiiyEnQWWXsr98ysDptD23Wgxmvb", "proofs": [ "4YJNsSMms6ytWgu9CDHpo1SFXcFzGAW2yLwerefiEb5tVcfxEtFnSHhRqBQTMHCUTXAjbxddNbqetqSbNNQhCpqw" ], "script": "base64:AAIEAAAAAAAAAAQIAhIAAAAAAwAAAAAIa2l0dGVuSWQCAAAALEd1b2JjSHZXOVdxb3Rua0dVajdKa3BjYlh0Z1ZmQjM3VEE0SmtnU2o5UWJiAQAAAApnZW5lcmF0aW9uAAAAAQAAAANudW0DAwkAAGYAAAACBQAAAANudW0AAAAAAAAAAAAGCQAAZwAAAAIAAAAAAAAAAGQFAAAAA251bQIAAAACRzEDAwkAAGYAAAACBQAAAANudW0AAAAAAAAAAGQGCQAAZwAAAAIAAAAAAAAAA4QFAAAAA251bQIAAAACRzICAAAAAkczAQAAAA1pc3N1ZUdlbmVDb2RlAAAAAAQAAAAJdGltZXN0YW1wCAUAAAAJbGFzdEJsb2NrAAAACXRpbWVzdGFtcAQAAAAMdGltZXN0YW1wU3RyCQABpAAAAAEFAAAACXRpbWVzdGFtcAQAAAAKdGltZXN0YW1wMgkBAAAACXRha2VSaWdodAAAAAIFAAAADHRpbWVzdGFtcFN0cgAAAAAAAAAAAgQAAAAHcGVyY2VudAkBAAAADXBhcnNlSW50VmFsdWUAAAABBQAAAAp0aW1lc3RhbXAyAw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AwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5MYyDAw==", "height": 1548588, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4U9nJ3jsAxdjVEBTSoMfVmFxVHbYZQ5Fe7V6L5rwk8xY Next: GftuRzV8GiAb1E98hTJq9QgTDGGcquBnoAU9zZcupCm5 Diff:
Old | New | Differences | |
---|---|---|---|
12 | 12 | else (900 >= num)) | |
13 | 13 | then "G2" | |
14 | 14 | else "G3" | |
15 | + | ||
16 | + | ||
17 | + | func issueGeneCode () = { | |
18 | + | let timestamp = lastBlock.timestamp | |
19 | + | let timestampStr = toString(timestamp) | |
20 | + | let timestamp2 = takeRight(timestampStr, 2) | |
21 | + | let percent = parseIntValue(timestamp2) | |
22 | + | if ((percent == 0)) | |
23 | + | then "AA-AA-AA-AA" | |
24 | + | else if (if ((percent > 0)) | |
25 | + | then true | |
26 | + | else (3 >= percent)) | |
27 | + | then "BB-BB-BB-BB" | |
28 | + | else if (if ((percent > 3)) | |
29 | + | then true | |
30 | + | else (8 >= percent)) | |
31 | + | then "CC-CC-CC-CC" | |
32 | + | else if (if ((percent > 8)) | |
33 | + | then true | |
34 | + | else (15 >= percent)) | |
35 | + | then "DD-DD-DD-DD" | |
36 | + | else if (if ((percent > 15)) | |
37 | + | then true | |
38 | + | else (24 >= percent)) | |
39 | + | then "EE-EE-EE-EE" | |
40 | + | else if (if ((percent > 24)) | |
41 | + | then true | |
42 | + | else (35 >= percent)) | |
43 | + | then "FF-FF-FF-FF" | |
44 | + | else if (if ((percent > 35)) | |
45 | + | then true | |
46 | + | else (48 >= percent)) | |
47 | + | then "GG-GG-GG-GG" | |
48 | + | else "HH-HH-HH-HH" | |
49 | + | } | |
15 | 50 | ||
16 | 51 | ||
17 | 52 | @Callable(i) | |
35 | 70 | else if ((300 > kittenAmount)) | |
36 | 71 | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
37 | 72 | else { | |
38 | - | let kittenNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false) | |
39 | - | let kittenNftId = calculateAssetId(kittenNft) | |
40 | - | [kittenNft, ScriptTransfer(i.caller, 1, kittenNftId)] | |
73 | + | let issueNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false) | |
74 | + | let issueNftId = calculateAssetId(issueNft) | |
75 | + | let nftTransfer = ScriptTransfer(i.caller, 1, issueNftId) | |
76 | + | let geneCode = issueGeneCode() | |
77 | + | [issueNft, nftTransfer, StringEntry(toBase58String(value(issueNftId)), geneCode)] | |
41 | 78 | } | |
42 | 79 | } | |
43 | 80 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let kittenId = "GuobcHvW9WqotnkGUj7JkpcbXtgVfB37TA4JkgSj9Qbb" | |
5 | 5 | ||
6 | 6 | func generation (num) = if (if ((num > 0)) | |
7 | 7 | then true | |
8 | 8 | else (100 >= num)) | |
9 | 9 | then "G1" | |
10 | 10 | else if (if ((num > 100)) | |
11 | 11 | then true | |
12 | 12 | else (900 >= num)) | |
13 | 13 | then "G2" | |
14 | 14 | else "G3" | |
15 | + | ||
16 | + | ||
17 | + | func issueGeneCode () = { | |
18 | + | let timestamp = lastBlock.timestamp | |
19 | + | let timestampStr = toString(timestamp) | |
20 | + | let timestamp2 = takeRight(timestampStr, 2) | |
21 | + | let percent = parseIntValue(timestamp2) | |
22 | + | if ((percent == 0)) | |
23 | + | then "AA-AA-AA-AA" | |
24 | + | else if (if ((percent > 0)) | |
25 | + | then true | |
26 | + | else (3 >= percent)) | |
27 | + | then "BB-BB-BB-BB" | |
28 | + | else if (if ((percent > 3)) | |
29 | + | then true | |
30 | + | else (8 >= percent)) | |
31 | + | then "CC-CC-CC-CC" | |
32 | + | else if (if ((percent > 8)) | |
33 | + | then true | |
34 | + | else (15 >= percent)) | |
35 | + | then "DD-DD-DD-DD" | |
36 | + | else if (if ((percent > 15)) | |
37 | + | then true | |
38 | + | else (24 >= percent)) | |
39 | + | then "EE-EE-EE-EE" | |
40 | + | else if (if ((percent > 24)) | |
41 | + | then true | |
42 | + | else (35 >= percent)) | |
43 | + | then "FF-FF-FF-FF" | |
44 | + | else if (if ((percent > 35)) | |
45 | + | then true | |
46 | + | else (48 >= percent)) | |
47 | + | then "GG-GG-GG-GG" | |
48 | + | else "HH-HH-HH-HH" | |
49 | + | } | |
15 | 50 | ||
16 | 51 | ||
17 | 52 | @Callable(i) | |
18 | 53 | func giveBirthKitten () = { | |
19 | 54 | let pmt = i.payments[0] | |
20 | 55 | let pmtId = toBase58String(value(pmt.assetId)) | |
21 | 56 | if ((pmtId != kittenId)) | |
22 | 57 | then throw("Please send Kitten token.") | |
23 | 58 | else { | |
24 | 59 | let kittenAmount = pmt.amount | |
25 | 60 | let issueQuantity = match getInteger(this, "issueQuantity") { | |
26 | 61 | case a: Int => | |
27 | 62 | a | |
28 | 63 | case _ => | |
29 | 64 | 0 | |
30 | 65 | } | |
31 | 66 | let newQuantity = (issueQuantity + 1) | |
32 | 67 | let generationType = generation(newQuantity) | |
33 | 68 | if ((kittenAmount > 300)) | |
34 | 69 | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
35 | 70 | else if ((300 > kittenAmount)) | |
36 | 71 | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
37 | 72 | else { | |
38 | - | let kittenNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false) | |
39 | - | let kittenNftId = calculateAssetId(kittenNft) | |
40 | - | [kittenNft, ScriptTransfer(i.caller, 1, kittenNftId)] | |
73 | + | let issueNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false) | |
74 | + | let issueNftId = calculateAssetId(issueNft) | |
75 | + | let nftTransfer = ScriptTransfer(i.caller, 1, issueNftId) | |
76 | + | let geneCode = issueGeneCode() | |
77 | + | [issueNft, nftTransfer, StringEntry(toBase58String(value(issueNftId)), geneCode)] | |
41 | 78 | } | |
42 | 79 | } | |
43 | 80 | } | |
44 | 81 | ||
45 | 82 | ||
46 | 83 | @Verifier(tx) | |
47 | 84 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
48 | 85 |
github/deemru/w8io/026f985 19.63 ms ◑