tx · EH6F1nYWZQHZZXjnwRsM9abBC79iw7zqgFtdv48bLezg 3NA3LRSigk6knLZ16uTzcdLNow2EQZtXTaJ: -0.01400000 Waves 2022.05.19 14:51 [2058515] smart account 3NA3LRSigk6knLZ16uTzcdLNow2EQZtXTaJ > SELF 0.00000000 Waves
{ "type": 13, "id": "EH6F1nYWZQHZZXjnwRsM9abBC79iw7zqgFtdv48bLezg", "fee": 1400000, "feeAssetId": null, "timestamp": 1652961086414, "version": 2, "chainId": 84, "sender": "3NA3LRSigk6knLZ16uTzcdLNow2EQZtXTaJ", "senderPublicKey": "ApEZSyUFWsckB3mZSWm3spfm6UPyDhMdrpxNhydohYs1", "proofs": [ "E3wTfeRu6X2Vw3y4QoDeMXgLzA8yFDH8SNDxuUbVGUNR5xWpnsTjYhmBnPEkewxayfWvCCJmSdVkT7mzbLZwsjf" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAAFwAAAAAJc2VwYXJhdG9yAgAAAAFfAAAAAA1rZXlDaGFyc0NvdW50AgAAAAtjaGFyc19jb3VudAAAAAAIa2V5T3duZXICAAAABW93bmVyAAAAAA1rZXlBcHBlYXJhbmNlAgAAAAphcHBlYXJhbmNlAAAAABNrZXlOYXR1cmFsUHlyb0JvbnVzAgAAABJuYXR1cmFsX3B5cm9fYm9udXMAAAAAE2tleU5hdHVyYWxBcXVhQm9udXMCAAAAEm5hdHVyYWxfYXF1YV9ib251cwAAAAAUa2V5TmF0dXJhbFRlcnJhQm9udXMCAAAAE25hdHVyYWxfdGVycmFfYm9udXMAAAAAE2tleU5hdHVyYWxBZXJvQm9udXMCAAAAEm5hdHVyYWxfYWVyb19ib251cwAAAAAVa2V5TmF0dXJhbEJhdHRsZUJvbnVzAgAAABRuYXR1cmFsX2JhdHRsZV9ib251cwAAAAAZa2V5TmF0dXJhbEdlbmVyYXRpbmdCb251cwIAAAAYbmF0dXJhbF9nZW5lcmF0aW5nX2JvbnVzAAAAAAZnb3ZBcHAJAQAAABFAZXh0ck5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gUAAAAZa2V5TmF0dXJhbEdlbmVyYXRpbmdCb251cwUAAAAGY2hhcklkBQAAABJuYXRHZW5lcmF0aW5nQm9udXMJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAADWtleUNoYXJzQ291bnQJAABkAAAAAgUAAAAGY2hhcklkAAAAAAAAAAABBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tlebUgd+U=", "height": 2058515, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4v2sTWWE6eWicKiGtzK46j5qao16bktZKRgrVPYToURs Next: EXwNpFyQTMEuMj5jXgaWK39M2TgcavB8UCLZmGcD4mxU Diff:
Old | New | Differences | |
---|---|---|---|
17 | 17 | ||
18 | 18 | let keyNaturalAeroBonus = "natural_aero_bonus" | |
19 | 19 | ||
20 | - | let | |
20 | + | let keyNaturalBattleBonus = "natural_battle_bonus" | |
21 | 21 | ||
22 | 22 | let keyNaturalGeneratingBonus = "natural_generating_bonus" | |
23 | 23 | ||
35 | 35 | ||
36 | 36 | let keyCharsNaturalElemBonusRanges = "chars_natural_elem_bonus_ranges" | |
37 | 37 | ||
38 | - | let | |
38 | + | let keyCharsNaturalBattleBonusRanges = "chars_natural_battle_bonus_ranges" | |
39 | 39 | ||
40 | 40 | let keyCharsNaturalGeneratingBonusRanges = "chars_natural_generating_bonus_ranges" | |
41 | 41 | ||
82 | 82 | let bT5 = parseIntValue(bonusRanges[4]) | |
83 | 83 | let bT6 = parseIntValue(bonusRanges[5]) | |
84 | 84 | let tierResult = randInt(0, 10000, txId, startingNonce) | |
85 | - | if (if ((tierResult >= 0)) | |
86 | - | then (sT1 >= tierResult) | |
87 | - | else false) | |
85 | + | if ((sT1 >= tierResult)) | |
88 | 86 | then randInt(0, bT1, txId, (startingNonce + 1)) | |
89 | - | else if (if ((tierResult > sT1)) | |
90 | - | then (sT2 >= tierResult) | |
91 | - | else false) | |
87 | + | else if ((sT2 >= tierResult)) | |
92 | 88 | then randInt((bT1 + 1), bT2, txId, (startingNonce + 2)) | |
93 | - | else if (if ((tierResult > sT2)) | |
94 | - | then (sT3 >= tierResult) | |
95 | - | else false) | |
89 | + | else if ((sT3 >= tierResult)) | |
96 | 90 | then randInt((bT2 + 1), bT3, txId, (startingNonce + 3)) | |
97 | - | else if (if ((tierResult > sT3)) | |
98 | - | then (sT4 >= tierResult) | |
99 | - | else false) | |
91 | + | else if ((sT4 >= tierResult)) | |
100 | 92 | then randInt((bT3 + 1), bT4, txId, (startingNonce + 4)) | |
101 | - | else if (if ((tierResult > sT4)) | |
102 | - | then (sT5 >= tierResult) | |
103 | - | else false) | |
93 | + | else if ((sT5 >= tierResult)) | |
104 | 94 | then randInt((bT4 + 1), bT5, txId, (startingNonce + 5)) | |
105 | - | else if (if ((tierResult > sT5)) | |
106 | - | then (sT6 >= tierResult) | |
107 | - | else false) | |
108 | - | then randInt((bT5 + 1), bT6, txId, (startingNonce + 6)) | |
109 | - | else throw("Unexpected error") | |
95 | + | else randInt((bT5 + 1), bT6, txId, (startingNonce + 6)) | |
110 | 96 | } | |
111 | 97 | ||
112 | 98 | ||
122 | 108 | let mouthsAmount = getIntegerValue(govApp, keyCharsMouthAmount) | |
123 | 109 | let statsTiersRanges = split(getStringValue(govApp, keyCharsStatsTiersRanges), separator) | |
124 | 110 | let natElemBonusRanges = split(getStringValue(govApp, keyCharsNaturalElemBonusRanges), separator) | |
125 | - | let | |
111 | + | let natBattleBonusRanges = split(getStringValue(govApp, keyCharsNaturalBattleBonusRanges), separator) | |
126 | 112 | let natGeneratingBonusRanges = split(getStringValue(govApp, keyCharsNaturalGeneratingBonusRanges), separator) | |
127 | 113 | let appearance = makeString([toString(randInt(1, bodiesAmount, txId, 0)), toString(randInt(1, eyesAmount, txId, 1)), toString(randInt(1, mouthsAmount, txId, 2))], separator) | |
128 | 114 | let natPyroBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 3, txId) | |
130 | 116 | let natTerraBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 17, txId) | |
131 | 117 | let natAeroBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 24, txId) | |
132 | 118 | let natGeneratingBonus = genRandomNaturalBonus(statsTiersRanges, natGeneratingBonusRanges, 31, txId) | |
133 | - | let | |
134 | - | [StringEntry(with(keyOwner, charId), callerAddr), StringEntry(with(keyAppearance, charId), appearance), IntegerEntry(with(keyNaturalPyroBonus, charId), natPyroBonus), IntegerEntry(with(keyNaturalAquaBonus, charId), natAquaBonus), IntegerEntry(with(keyNaturalTerraBonus, charId), natTerraBonus), IntegerEntry(with(keyNaturalAeroBonus, charId), natAeroBonus), IntegerEntry(with( | |
119 | + | let natBattleBonus = genRandomNaturalBonus(statsTiersRanges, natBattleBonusRanges, 38, txId) | |
120 | + | [StringEntry(with(keyOwner, charId), callerAddr), StringEntry(with(keyAppearance, charId), appearance), IntegerEntry(with(keyNaturalPyroBonus, charId), natPyroBonus), IntegerEntry(with(keyNaturalAquaBonus, charId), natAquaBonus), IntegerEntry(with(keyNaturalTerraBonus, charId), natTerraBonus), IntegerEntry(with(keyNaturalAeroBonus, charId), natAeroBonus), IntegerEntry(with(keyNaturalBattleBonus, charId), natBattleBonus), IntegerEntry(with(keyNaturalGeneratingBonus, charId), natGeneratingBonus), IntegerEntry(keyCharsCount, (charId + 1))] | |
135 | 121 | } | |
136 | 122 | ||
137 | 123 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "_" | |
5 | 5 | ||
6 | 6 | let keyCharsCount = "chars_count" | |
7 | 7 | ||
8 | 8 | let keyOwner = "owner" | |
9 | 9 | ||
10 | 10 | let keyAppearance = "appearance" | |
11 | 11 | ||
12 | 12 | let keyNaturalPyroBonus = "natural_pyro_bonus" | |
13 | 13 | ||
14 | 14 | let keyNaturalAquaBonus = "natural_aqua_bonus" | |
15 | 15 | ||
16 | 16 | let keyNaturalTerraBonus = "natural_terra_bonus" | |
17 | 17 | ||
18 | 18 | let keyNaturalAeroBonus = "natural_aero_bonus" | |
19 | 19 | ||
20 | - | let | |
20 | + | let keyNaturalBattleBonus = "natural_battle_bonus" | |
21 | 21 | ||
22 | 22 | let keyNaturalGeneratingBonus = "natural_generating_bonus" | |
23 | 23 | ||
24 | 24 | let govApp = addressFromStringValue("3MyxfwvbueUBynYHfQsutNXZNqNozGiMnsG") | |
25 | 25 | ||
26 | 26 | let keyEcosystemAddresses = "ecosystem_addresses" | |
27 | 27 | ||
28 | 28 | let keyCharsBodyAmount = "chars_body_amount" | |
29 | 29 | ||
30 | 30 | let keyCharsEyesAmount = "chars_eyes_amount" | |
31 | 31 | ||
32 | 32 | let keyCharsMouthAmount = "chars_mouth_amount" | |
33 | 33 | ||
34 | 34 | let keyCharsStatsTiersRanges = "chars_stats_tiers_ranges" | |
35 | 35 | ||
36 | 36 | let keyCharsNaturalElemBonusRanges = "chars_natural_elem_bonus_ranges" | |
37 | 37 | ||
38 | - | let | |
38 | + | let keyCharsNaturalBattleBonusRanges = "chars_natural_battle_bonus_ranges" | |
39 | 39 | ||
40 | 40 | let keyCharsNaturalGeneratingBonusRanges = "chars_natural_generating_bonus_ranges" | |
41 | 41 | ||
42 | 42 | func invokeChecks (callerAddr) = if ((isDataStorageUntouched(govApp) != false)) | |
43 | 43 | then throw("Governing app not ready") | |
44 | 44 | else { | |
45 | 45 | let ecosystemAddresses = getStringValue(govApp, keyEcosystemAddresses) | |
46 | 46 | if ((contains(ecosystemAddresses, toString(callerAddr)) != false)) | |
47 | 47 | then throw("Access denied") | |
48 | 48 | else true | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func with (a,b) = { | |
53 | 53 | let c = match b { | |
54 | 54 | case isInt: Int => | |
55 | 55 | toString(isInt) | |
56 | 56 | case isStr: String => | |
57 | 57 | isStr | |
58 | 58 | case _ => | |
59 | 59 | throw("Matching issue in with function") | |
60 | 60 | } | |
61 | 61 | ((c + separator) + a) | |
62 | 62 | } | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func randInt (min,max,txId,nonce) = { | |
66 | 66 | let hash = value(sha256_16Kb(((value(value(blockInfoByHeight(height)).vrf) + txId) + toBytes(nonce)))) | |
67 | 67 | value(((value(toInt(hash)) % ((max - min) + 1)) + min)) | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func genRandomNaturalBonus (statsTierRanges,bonusRanges,startingNonce,txId) = { | |
72 | 72 | let sT1 = parseIntValue(statsTierRanges[0]) | |
73 | 73 | let sT2 = parseIntValue(statsTierRanges[1]) | |
74 | 74 | let sT3 = parseIntValue(statsTierRanges[2]) | |
75 | 75 | let sT4 = parseIntValue(statsTierRanges[3]) | |
76 | 76 | let sT5 = parseIntValue(statsTierRanges[4]) | |
77 | 77 | let sT6 = parseIntValue(statsTierRanges[5]) | |
78 | 78 | let bT1 = parseIntValue(bonusRanges[0]) | |
79 | 79 | let bT2 = parseIntValue(bonusRanges[1]) | |
80 | 80 | let bT3 = parseIntValue(bonusRanges[2]) | |
81 | 81 | let bT4 = parseIntValue(bonusRanges[3]) | |
82 | 82 | let bT5 = parseIntValue(bonusRanges[4]) | |
83 | 83 | let bT6 = parseIntValue(bonusRanges[5]) | |
84 | 84 | let tierResult = randInt(0, 10000, txId, startingNonce) | |
85 | - | if (if ((tierResult >= 0)) | |
86 | - | then (sT1 >= tierResult) | |
87 | - | else false) | |
85 | + | if ((sT1 >= tierResult)) | |
88 | 86 | then randInt(0, bT1, txId, (startingNonce + 1)) | |
89 | - | else if (if ((tierResult > sT1)) | |
90 | - | then (sT2 >= tierResult) | |
91 | - | else false) | |
87 | + | else if ((sT2 >= tierResult)) | |
92 | 88 | then randInt((bT1 + 1), bT2, txId, (startingNonce + 2)) | |
93 | - | else if (if ((tierResult > sT2)) | |
94 | - | then (sT3 >= tierResult) | |
95 | - | else false) | |
89 | + | else if ((sT3 >= tierResult)) | |
96 | 90 | then randInt((bT2 + 1), bT3, txId, (startingNonce + 3)) | |
97 | - | else if (if ((tierResult > sT3)) | |
98 | - | then (sT4 >= tierResult) | |
99 | - | else false) | |
91 | + | else if ((sT4 >= tierResult)) | |
100 | 92 | then randInt((bT3 + 1), bT4, txId, (startingNonce + 4)) | |
101 | - | else if (if ((tierResult > sT4)) | |
102 | - | then (sT5 >= tierResult) | |
103 | - | else false) | |
93 | + | else if ((sT5 >= tierResult)) | |
104 | 94 | then randInt((bT4 + 1), bT5, txId, (startingNonce + 5)) | |
105 | - | else if (if ((tierResult > sT5)) | |
106 | - | then (sT6 >= tierResult) | |
107 | - | else false) | |
108 | - | then randInt((bT5 + 1), bT6, txId, (startingNonce + 6)) | |
109 | - | else throw("Unexpected error") | |
95 | + | else randInt((bT5 + 1), bT6, txId, (startingNonce + 6)) | |
110 | 96 | } | |
111 | 97 | ||
112 | 98 | ||
113 | 99 | @Callable(i) | |
114 | 100 | func createChar () = if ((invokeChecks(i.caller) != true)) | |
115 | 101 | then throw() | |
116 | 102 | else { | |
117 | 103 | let txId = i.transactionId | |
118 | 104 | let callerAddr = toBase58String(i.caller.bytes) | |
119 | 105 | let charId = valueOrElse(getInteger(this, keyCharsCount), 1) | |
120 | 106 | let bodiesAmount = getIntegerValue(govApp, keyCharsBodyAmount) | |
121 | 107 | let eyesAmount = getIntegerValue(govApp, keyCharsEyesAmount) | |
122 | 108 | let mouthsAmount = getIntegerValue(govApp, keyCharsMouthAmount) | |
123 | 109 | let statsTiersRanges = split(getStringValue(govApp, keyCharsStatsTiersRanges), separator) | |
124 | 110 | let natElemBonusRanges = split(getStringValue(govApp, keyCharsNaturalElemBonusRanges), separator) | |
125 | - | let | |
111 | + | let natBattleBonusRanges = split(getStringValue(govApp, keyCharsNaturalBattleBonusRanges), separator) | |
126 | 112 | let natGeneratingBonusRanges = split(getStringValue(govApp, keyCharsNaturalGeneratingBonusRanges), separator) | |
127 | 113 | let appearance = makeString([toString(randInt(1, bodiesAmount, txId, 0)), toString(randInt(1, eyesAmount, txId, 1)), toString(randInt(1, mouthsAmount, txId, 2))], separator) | |
128 | 114 | let natPyroBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 3, txId) | |
129 | 115 | let natAquaBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 10, txId) | |
130 | 116 | let natTerraBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 17, txId) | |
131 | 117 | let natAeroBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 24, txId) | |
132 | 118 | let natGeneratingBonus = genRandomNaturalBonus(statsTiersRanges, natGeneratingBonusRanges, 31, txId) | |
133 | - | let | |
134 | - | [StringEntry(with(keyOwner, charId), callerAddr), StringEntry(with(keyAppearance, charId), appearance), IntegerEntry(with(keyNaturalPyroBonus, charId), natPyroBonus), IntegerEntry(with(keyNaturalAquaBonus, charId), natAquaBonus), IntegerEntry(with(keyNaturalTerraBonus, charId), natTerraBonus), IntegerEntry(with(keyNaturalAeroBonus, charId), natAeroBonus), IntegerEntry(with( | |
119 | + | let natBattleBonus = genRandomNaturalBonus(statsTiersRanges, natBattleBonusRanges, 38, txId) | |
120 | + | [StringEntry(with(keyOwner, charId), callerAddr), StringEntry(with(keyAppearance, charId), appearance), IntegerEntry(with(keyNaturalPyroBonus, charId), natPyroBonus), IntegerEntry(with(keyNaturalAquaBonus, charId), natAquaBonus), IntegerEntry(with(keyNaturalTerraBonus, charId), natTerraBonus), IntegerEntry(with(keyNaturalAeroBonus, charId), natAeroBonus), IntegerEntry(with(keyNaturalBattleBonus, charId), natBattleBonus), IntegerEntry(with(keyNaturalGeneratingBonus, charId), natGeneratingBonus), IntegerEntry(keyCharsCount, (charId + 1))] | |
135 | 121 | } | |
136 | 122 | ||
137 | 123 | ||
138 | 124 | @Verifier(tx) | |
139 | 125 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
140 | 126 |
github/deemru/w8io/169f3d6 43.71 ms ◑