tx · AsjHif3X6EHdbd1PNB3PbopfWyf3zkUgMycGsLCGHBPA 3MsH95R1SdYUEkUTVjHvR8gLD8rXtgQ21Vj: -0.04000000 Waves 2022.02.03 15:28 [1907419] smart account 3MsH95R1SdYUEkUTVjHvR8gLD8rXtgQ21Vj > SELF 0.00000000 Waves
{ "type": 13, "id": "AsjHif3X6EHdbd1PNB3PbopfWyf3zkUgMycGsLCGHBPA", "fee": 4000000, "feeAssetId": null, "timestamp": 1643891316810, "version": 2, "chainId": 84, "sender": "3MsH95R1SdYUEkUTVjHvR8gLD8rXtgQ21Vj", "senderPublicKey": "GYeGBXmJUHrtkkJuLVJKCHtaCbkvj9nS4aVLqzdrbpZx", "proofs": [ "2vXjaJ8Ww6T4PmFC6udJFoABYXoS1zJxmGv7Lr5BGtwgtHg1Uma3tLi8qzCoMqno2yUNcX4nDsmnVdLiRBKTd7mr" ], "script": "base64:AAIFAAAAAAAAAAwIAhIICgYIAQEBAQEAAAAjAAAAAAZwYXJhbXMJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNOMXVkRThxSnRITkMxaGlabVZFdFZyWlA3dUZUOFM2M2FnAAAAAA1rZXlJbml0VjFEb25lAgAAAAxpbml0X3YxX2RvbmUAAAAACmtleVRva2VuSWQCAAAAB3Rva2VuSWQAAAAAG2tleUluaXRpYWxDaGFyQ3JlYXRpb25TdGF0cwIAAAAYaW5pdGlhbENoYXJDcmVhdGlvblN0YXRzAAAAAAlzZXBhcmF0b3ICAAAAAV8AAAAAB2tleU5hbWUCAAAABG5hbWUAAAAABmtleVNleAIAAAADc2V4AAAAAAdrZXlSYW5rAgAAAARyYW5rAAAAABBrZXlIZWFsdGhDdXJyZW50AgAAAA1oZWFsdGhDdXJyZW50AAAAAAxrZXlIZWFsdGhNYXgCAAAACWhlYWx0aE1heAAAAAATa2V5TWluSGVhbHRoUGVyUmFuawIAAAAQbWluSGVhbHRoUGVyUmFuawAAAAATa2V5TWF4SGVhbHRoUGVyU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AAAAAAAAQUAAAAGY2hhcklkBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleULe9JI=", "height": 1907419, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 13VzYAup8V4dL7vgMb1tWLCUMtMcwGrGnc1SibFqzSvD Next: none Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let params = addressFromStringValue("3N1udE8qJtHNC1hiZmVEtVrZP7uFT8S63ag") | |
5 | + | ||
6 | + | let keyInitV1Done = "init_v1_done" | |
7 | + | ||
8 | + | let keyTokenId = "tokenId" | |
9 | + | ||
10 | + | let keyInitialCharCreationStats = "initialCharCreationStats" | |
11 | + | ||
12 | + | let separator = "_" | |
13 | + | ||
14 | + | let keyName = "name" | |
15 | + | ||
16 | + | let keySex = "sex" | |
17 | + | ||
18 | + | let keyRank = "rank" | |
19 | + | ||
20 | + | let keyHealthCurrent = "healthCurrent" | |
21 | + | ||
22 | + | let keyHealthMax = "healthMax" | |
23 | + | ||
24 | + | let keyMinHealthPerRank = "minHealthPerRank" | |
25 | + | ||
26 | + | let keyMaxHealthPerRank = "maxHealthPerRank" | |
27 | + | ||
28 | + | let keyHealthRegen = "healthRegen" | |
29 | + | ||
30 | + | let keyMinHealthRegenPerRank = "minHealthRegenPerRank" | |
31 | + | ||
32 | + | let keyMaxHealthRegenPerRank = "maxHealthRegenPerRank" | |
33 | + | ||
34 | + | let keyManaCurrent = "manaCurrent" | |
35 | + | ||
36 | + | let keyManaMax = "manaMax" | |
37 | + | ||
38 | + | let keyMinManaPerRank = "minManaPerRank" | |
39 | + | ||
40 | + | let keyMaxManaPerRank = "maxManaPerRank" | |
41 | + | ||
42 | + | let keyManaRegen = "manaRegen" | |
43 | + | ||
44 | + | let keyMinManaRegenPerRank = "minManaRegenPerRank" | |
45 | + | ||
46 | + | let keyMaxManaRegenPerRank = "maxManaRegenPerRank" | |
47 | + | ||
48 | + | let keyPyro = "pyro" | |
49 | + | ||
50 | + | let keyMinPyroPerRank = "minPyroPerRank" | |
51 | + | ||
52 | + | let keyMaxPyroPerRank = "maxPyroPerRank" | |
53 | + | ||
54 | + | let keyAero = "aero" | |
55 | + | ||
56 | + | let keyMinAeroPerRank = "minAeroPerRank" | |
57 | + | ||
58 | + | let keyMaxAeroPerRank = "maxAeroPerRank" | |
59 | + | ||
60 | + | let keyAqua = "aqua" | |
61 | + | ||
62 | + | let keyMinAquaPerRank = "minAquaPerRank" | |
63 | + | ||
64 | + | let keyMaxAquaPerRank = "maxAquaPerRank" | |
65 | + | ||
66 | + | let keyTerra = "terra" | |
67 | + | ||
68 | + | let keyMinTerraPerRank = "minTerraPerRank" | |
69 | + | ||
70 | + | let keyMaxTerraPerRank = "maxTerraPerRank" | |
71 | + | ||
72 | + | func with (str1,str2) = ((str1 + separator) + str2) | |
4 | 73 | ||
5 | 74 | ||
6 | 75 | @Callable(i) | |
7 | - | func call () = { | |
8 | - | let asset = Issue("Asset", "", 1, 0, true, unit, 0) | |
9 | - | let assetId = calculateAssetId(asset) | |
10 | - | [BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), asset, Reissue(assetId, 1, false), Burn(assetId, 1), ScriptTransfer(i.caller, 1, assetId)] | |
76 | + | func create (name,sex,pyro,aero,aqua,terra) = { | |
77 | + | let initialStats = split(getStringValue(params, keyInitialCharCreationStats), separator) | |
78 | + | let nameSize = size(name) | |
79 | + | if (if ((parseIntValue(initialStats[0]) > nameSize)) | |
80 | + | then true | |
81 | + | else (nameSize > parseIntValue(initialStats[1]))) | |
82 | + | then throw("Char name size not valid") | |
83 | + | else if (if (contains(name, " ")) | |
84 | + | then true | |
85 | + | else contains(name, separator)) | |
86 | + | then throw((("Whitespaces or " + separator) + " not allowed")) | |
87 | + | else if (if ((sex != 1)) | |
88 | + | then (sex != 2) | |
89 | + | else false) | |
90 | + | then throw("Somethings wrong with char sex") | |
91 | + | else if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (((((pyro + aero) + aqua) + terra) != 14)) | |
92 | + | then true | |
93 | + | else (2 > pyro)) | |
94 | + | then true | |
95 | + | else (pyro > 5)) | |
96 | + | then true | |
97 | + | else (2 > aero)) | |
98 | + | then true | |
99 | + | else (aero > 5)) | |
100 | + | then true | |
101 | + | else (2 > aqua)) | |
102 | + | then true | |
103 | + | else (aqua > 5)) | |
104 | + | then true | |
105 | + | else (2 > terra)) | |
106 | + | then true | |
107 | + | else (terra > 5)) | |
108 | + | then true | |
109 | + | else (pyro == aero)) | |
110 | + | then true | |
111 | + | else (pyro == aqua)) | |
112 | + | then true | |
113 | + | else (pyro == terra)) | |
114 | + | then true | |
115 | + | else (aero == aqua)) | |
116 | + | then true | |
117 | + | else (aero == terra)) | |
118 | + | then true | |
119 | + | else (aqua == terra)) | |
120 | + | then throw("Elem spec issue") | |
121 | + | else { | |
122 | + | let charIssue = Issue(name, "", 1, 0, false, unit, 0) | |
123 | + | let charId = calculateAssetId(charIssue) | |
124 | + | let charIdStr = toBase58String(charId) | |
125 | + | [StringEntry(with(keyName, charIdStr), name), IntegerEntry(with(keySex, charIdStr), sex), IntegerEntry(with(keyRank, charIdStr), 1), IntegerEntry(with(keyHealthCurrent, charIdStr), parseIntValue(initialStats[2])), IntegerEntry(with(keyHealthMax, charIdStr), parseIntValue(initialStats[2])), IntegerEntry(with(keyMinHealthPerRank, charIdStr), parseIntValue(initialStats[3])), IntegerEntry(with(keyMaxHealthPerRank, charIdStr), parseIntValue(initialStats[4])), IntegerEntry(with(keyHealthRegen, charIdStr), parseIntValue(initialStats[5])), IntegerEntry(with(keyMinHealthRegenPerRank, charIdStr), parseIntValue(initialStats[6])), IntegerEntry(with(keyMaxHealthRegenPerRank, charIdStr), parseIntValue(initialStats[7])), IntegerEntry(with(keyManaCurrent, charIdStr), parseIntValue(initialStats[8])), IntegerEntry(with(keyManaMax, charIdStr), parseIntValue(initialStats[8])), IntegerEntry(with(keyMinManaPerRank, charIdStr), parseIntValue(initialStats[9])), IntegerEntry(with(keyMaxManaPerRank, charIdStr), parseIntValue(initialStats[10])), IntegerEntry(with(keyManaRegen, charIdStr), parseIntValue(initialStats[11])), IntegerEntry(with(keyMinManaRegenPerRank, charIdStr), parseIntValue(initialStats[12])), IntegerEntry(with(keyMaxManaRegenPerRank, charIdStr), parseIntValue(initialStats[13])), IntegerEntry(with(keyPyro, charIdStr), pyro), IntegerEntry(with(keyMinPyroPerRank, charIdStr), parseIntValue(initialStats[14])), IntegerEntry(with(keyMaxPyroPerRank, charIdStr), pyro), IntegerEntry(with(keyAero, charIdStr), aero), IntegerEntry(with(keyMinAeroPerRank, charIdStr), parseIntValue(initialStats[15])), IntegerEntry(with(keyMaxAeroPerRank, charIdStr), aero), IntegerEntry(with(keyAqua, charIdStr), aqua), IntegerEntry(with(keyMinAquaPerRank, charIdStr), parseIntValue(initialStats[16])), IntegerEntry(with(keyMaxAquaPerRank, charIdStr), aqua), IntegerEntry(with(keyTerra, charIdStr), terra), IntegerEntry(with(keyMinTerraPerRank, charIdStr), parseIntValue(initialStats[17])), IntegerEntry(with(keyMaxTerraPerRank, charIdStr), terra), charIssue, ScriptTransfer(i.caller, 1, charId)] | |
126 | + | } | |
11 | 127 | } | |
12 | 128 | ||
13 | 129 |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let params = addressFromStringValue("3N1udE8qJtHNC1hiZmVEtVrZP7uFT8S63ag") | |
5 | + | ||
6 | + | let keyInitV1Done = "init_v1_done" | |
7 | + | ||
8 | + | let keyTokenId = "tokenId" | |
9 | + | ||
10 | + | let keyInitialCharCreationStats = "initialCharCreationStats" | |
11 | + | ||
12 | + | let separator = "_" | |
13 | + | ||
14 | + | let keyName = "name" | |
15 | + | ||
16 | + | let keySex = "sex" | |
17 | + | ||
18 | + | let keyRank = "rank" | |
19 | + | ||
20 | + | let keyHealthCurrent = "healthCurrent" | |
21 | + | ||
22 | + | let keyHealthMax = "healthMax" | |
23 | + | ||
24 | + | let keyMinHealthPerRank = "minHealthPerRank" | |
25 | + | ||
26 | + | let keyMaxHealthPerRank = "maxHealthPerRank" | |
27 | + | ||
28 | + | let keyHealthRegen = "healthRegen" | |
29 | + | ||
30 | + | let keyMinHealthRegenPerRank = "minHealthRegenPerRank" | |
31 | + | ||
32 | + | let keyMaxHealthRegenPerRank = "maxHealthRegenPerRank" | |
33 | + | ||
34 | + | let keyManaCurrent = "manaCurrent" | |
35 | + | ||
36 | + | let keyManaMax = "manaMax" | |
37 | + | ||
38 | + | let keyMinManaPerRank = "minManaPerRank" | |
39 | + | ||
40 | + | let keyMaxManaPerRank = "maxManaPerRank" | |
41 | + | ||
42 | + | let keyManaRegen = "manaRegen" | |
43 | + | ||
44 | + | let keyMinManaRegenPerRank = "minManaRegenPerRank" | |
45 | + | ||
46 | + | let keyMaxManaRegenPerRank = "maxManaRegenPerRank" | |
47 | + | ||
48 | + | let keyPyro = "pyro" | |
49 | + | ||
50 | + | let keyMinPyroPerRank = "minPyroPerRank" | |
51 | + | ||
52 | + | let keyMaxPyroPerRank = "maxPyroPerRank" | |
53 | + | ||
54 | + | let keyAero = "aero" | |
55 | + | ||
56 | + | let keyMinAeroPerRank = "minAeroPerRank" | |
57 | + | ||
58 | + | let keyMaxAeroPerRank = "maxAeroPerRank" | |
59 | + | ||
60 | + | let keyAqua = "aqua" | |
61 | + | ||
62 | + | let keyMinAquaPerRank = "minAquaPerRank" | |
63 | + | ||
64 | + | let keyMaxAquaPerRank = "maxAquaPerRank" | |
65 | + | ||
66 | + | let keyTerra = "terra" | |
67 | + | ||
68 | + | let keyMinTerraPerRank = "minTerraPerRank" | |
69 | + | ||
70 | + | let keyMaxTerraPerRank = "maxTerraPerRank" | |
71 | + | ||
72 | + | func with (str1,str2) = ((str1 + separator) + str2) | |
4 | 73 | ||
5 | 74 | ||
6 | 75 | @Callable(i) | |
7 | - | func call () = { | |
8 | - | let asset = Issue("Asset", "", 1, 0, true, unit, 0) | |
9 | - | let assetId = calculateAssetId(asset) | |
10 | - | [BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), asset, Reissue(assetId, 1, false), Burn(assetId, 1), ScriptTransfer(i.caller, 1, assetId)] | |
76 | + | func create (name,sex,pyro,aero,aqua,terra) = { | |
77 | + | let initialStats = split(getStringValue(params, keyInitialCharCreationStats), separator) | |
78 | + | let nameSize = size(name) | |
79 | + | if (if ((parseIntValue(initialStats[0]) > nameSize)) | |
80 | + | then true | |
81 | + | else (nameSize > parseIntValue(initialStats[1]))) | |
82 | + | then throw("Char name size not valid") | |
83 | + | else if (if (contains(name, " ")) | |
84 | + | then true | |
85 | + | else contains(name, separator)) | |
86 | + | then throw((("Whitespaces or " + separator) + " not allowed")) | |
87 | + | else if (if ((sex != 1)) | |
88 | + | then (sex != 2) | |
89 | + | else false) | |
90 | + | then throw("Somethings wrong with char sex") | |
91 | + | else if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (((((pyro + aero) + aqua) + terra) != 14)) | |
92 | + | then true | |
93 | + | else (2 > pyro)) | |
94 | + | then true | |
95 | + | else (pyro > 5)) | |
96 | + | then true | |
97 | + | else (2 > aero)) | |
98 | + | then true | |
99 | + | else (aero > 5)) | |
100 | + | then true | |
101 | + | else (2 > aqua)) | |
102 | + | then true | |
103 | + | else (aqua > 5)) | |
104 | + | then true | |
105 | + | else (2 > terra)) | |
106 | + | then true | |
107 | + | else (terra > 5)) | |
108 | + | then true | |
109 | + | else (pyro == aero)) | |
110 | + | then true | |
111 | + | else (pyro == aqua)) | |
112 | + | then true | |
113 | + | else (pyro == terra)) | |
114 | + | then true | |
115 | + | else (aero == aqua)) | |
116 | + | then true | |
117 | + | else (aero == terra)) | |
118 | + | then true | |
119 | + | else (aqua == terra)) | |
120 | + | then throw("Elem spec issue") | |
121 | + | else { | |
122 | + | let charIssue = Issue(name, "", 1, 0, false, unit, 0) | |
123 | + | let charId = calculateAssetId(charIssue) | |
124 | + | let charIdStr = toBase58String(charId) | |
125 | + | [StringEntry(with(keyName, charIdStr), name), IntegerEntry(with(keySex, charIdStr), sex), IntegerEntry(with(keyRank, charIdStr), 1), IntegerEntry(with(keyHealthCurrent, charIdStr), parseIntValue(initialStats[2])), IntegerEntry(with(keyHealthMax, charIdStr), parseIntValue(initialStats[2])), IntegerEntry(with(keyMinHealthPerRank, charIdStr), parseIntValue(initialStats[3])), IntegerEntry(with(keyMaxHealthPerRank, charIdStr), parseIntValue(initialStats[4])), IntegerEntry(with(keyHealthRegen, charIdStr), parseIntValue(initialStats[5])), IntegerEntry(with(keyMinHealthRegenPerRank, charIdStr), parseIntValue(initialStats[6])), IntegerEntry(with(keyMaxHealthRegenPerRank, charIdStr), parseIntValue(initialStats[7])), IntegerEntry(with(keyManaCurrent, charIdStr), parseIntValue(initialStats[8])), IntegerEntry(with(keyManaMax, charIdStr), parseIntValue(initialStats[8])), IntegerEntry(with(keyMinManaPerRank, charIdStr), parseIntValue(initialStats[9])), IntegerEntry(with(keyMaxManaPerRank, charIdStr), parseIntValue(initialStats[10])), IntegerEntry(with(keyManaRegen, charIdStr), parseIntValue(initialStats[11])), IntegerEntry(with(keyMinManaRegenPerRank, charIdStr), parseIntValue(initialStats[12])), IntegerEntry(with(keyMaxManaRegenPerRank, charIdStr), parseIntValue(initialStats[13])), IntegerEntry(with(keyPyro, charIdStr), pyro), IntegerEntry(with(keyMinPyroPerRank, charIdStr), parseIntValue(initialStats[14])), IntegerEntry(with(keyMaxPyroPerRank, charIdStr), pyro), IntegerEntry(with(keyAero, charIdStr), aero), IntegerEntry(with(keyMinAeroPerRank, charIdStr), parseIntValue(initialStats[15])), IntegerEntry(with(keyMaxAeroPerRank, charIdStr), aero), IntegerEntry(with(keyAqua, charIdStr), aqua), IntegerEntry(with(keyMinAquaPerRank, charIdStr), parseIntValue(initialStats[16])), IntegerEntry(with(keyMaxAquaPerRank, charIdStr), aqua), IntegerEntry(with(keyTerra, charIdStr), terra), IntegerEntry(with(keyMinTerraPerRank, charIdStr), parseIntValue(initialStats[17])), IntegerEntry(with(keyMaxTerraPerRank, charIdStr), terra), charIssue, ScriptTransfer(i.caller, 1, charId)] | |
126 | + | } | |
11 | 127 | } | |
12 | 128 | ||
13 | 129 | ||
14 | 130 | @Verifier(tx) | |
15 | 131 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
16 | 132 |
github/deemru/w8io/169f3d6 32.99 ms ◑