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:AAIFAAAAAAAAAAQIAhIAAAAAFwAAAAAJc2VwYXJhdG9yAgAAAAFfAAAAAA1rZXlDaGFyc0NvdW50AgAAAAtjaGFyc19jb3VudAAAAAAIa2V5T3duZXICAAAABW93bmVyAAAAAA1rZXlBcHBlYXJhbmNlAgAAAAphcHBlYXJhbmNlAAAAABNrZXlOYXR1cmFsUHlyb0JvbnVzAgAAABJuYXR1cmFsX3B5cm9fYm9udXMAAAAAE2tleU5hdHVyYWxBcXVhQm9udXMCAAAAEm5hdHVyYWxfYXF1YV9ib251cwAAAAAUa2V5TmF0dXJhbFRlcnJhQm9udXMCAAAAE25hdHVyYWxfdGVycmFfYm9udXMAAAAAE2tleU5hdHVyYWxBZXJvQm9udXMCAAAAEm5hdHVyYWxfYWVyb19ib251cwAAAAAVa2V5TmF0dXJhbEJhdHRsZUJvbnVzAgAAABRuYXR1cmFsX2JhdHRsZV9ib251cwAAAAAZa2V5TmF0dXJhbEdlbmVyYXRpbmdCb251cwIAAAAYbmF0dXJhbF9nZW5lcmF0aW5nX2JvbnVzAAAAAAZnb3ZBcHAJAQAAABFAZXh0ck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AgUAAAAZa2V5TmF0dXJhbEdlbmVyYXRpbmdCb251cwUAAAAGY2hhcklkBQAAABJuYXRHZW5lcmF0aW5nQm9udXMJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAADWtleUNoYXJzQ291bnQJAABkAAAAAgUAAAAGY2hhcklkAAAAAAAAAAABBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tlebUgd+U=", "height": 2058515, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4v2sTWWE6eWicKiGtzK46j5qao16bktZKRgrVPYToURs Next: EXwNpFyQTMEuMj5jXgaWK39M2TgcavB8UCLZmGcD4mxU Diff:
OldNewDifferences
1717
1818 let keyNaturalAeroBonus = "natural_aero_bonus"
1919
20-let keyNaturalLootsBonus = "natural_loots_bonus"
20+let keyNaturalBattleBonus = "natural_battle_bonus"
2121
2222 let keyNaturalGeneratingBonus = "natural_generating_bonus"
2323
3535
3636 let keyCharsNaturalElemBonusRanges = "chars_natural_elem_bonus_ranges"
3737
38-let keyCharsNaturalLootsBonusRanges = "chars_natural_loots_bonus_ranges"
38+let keyCharsNaturalBattleBonusRanges = "chars_natural_battle_bonus_ranges"
3939
4040 let keyCharsNaturalGeneratingBonusRanges = "chars_natural_generating_bonus_ranges"
4141
8282 let bT5 = parseIntValue(bonusRanges[4])
8383 let bT6 = parseIntValue(bonusRanges[5])
8484 let tierResult = randInt(0, 10000, txId, startingNonce)
85- if (if ((tierResult >= 0))
86- then (sT1 >= tierResult)
87- else false)
85+ if ((sT1 >= tierResult))
8886 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))
9288 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))
9690 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))
10092 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))
10494 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))
11096 }
11197
11298
122108 let mouthsAmount = getIntegerValue(govApp, keyCharsMouthAmount)
123109 let statsTiersRanges = split(getStringValue(govApp, keyCharsStatsTiersRanges), separator)
124110 let natElemBonusRanges = split(getStringValue(govApp, keyCharsNaturalElemBonusRanges), separator)
125- let natLootsBonusRanges = split(getStringValue(govApp, keyCharsNaturalLootsBonusRanges), separator)
111+ let natBattleBonusRanges = split(getStringValue(govApp, keyCharsNaturalBattleBonusRanges), separator)
126112 let natGeneratingBonusRanges = split(getStringValue(govApp, keyCharsNaturalGeneratingBonusRanges), separator)
127113 let appearance = makeString([toString(randInt(1, bodiesAmount, txId, 0)), toString(randInt(1, eyesAmount, txId, 1)), toString(randInt(1, mouthsAmount, txId, 2))], separator)
128114 let natPyroBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 3, txId)
130116 let natTerraBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 17, txId)
131117 let natAeroBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 24, txId)
132118 let natGeneratingBonus = genRandomNaturalBonus(statsTiersRanges, natGeneratingBonusRanges, 31, txId)
133- let natLootsBonus = genRandomNaturalBonus(statsTiersRanges, natLootsBonusRanges, 38, txId)
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(keyNaturalLootsBonus, charId), natLootsBonus), IntegerEntry(with(keyNaturalGeneratingBonus, charId), natGeneratingBonus), IntegerEntry(keyCharsCount, (charId + 1))]
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))]
135121 }
136122
137123
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separator = "_"
55
66 let keyCharsCount = "chars_count"
77
88 let keyOwner = "owner"
99
1010 let keyAppearance = "appearance"
1111
1212 let keyNaturalPyroBonus = "natural_pyro_bonus"
1313
1414 let keyNaturalAquaBonus = "natural_aqua_bonus"
1515
1616 let keyNaturalTerraBonus = "natural_terra_bonus"
1717
1818 let keyNaturalAeroBonus = "natural_aero_bonus"
1919
20-let keyNaturalLootsBonus = "natural_loots_bonus"
20+let keyNaturalBattleBonus = "natural_battle_bonus"
2121
2222 let keyNaturalGeneratingBonus = "natural_generating_bonus"
2323
2424 let govApp = addressFromStringValue("3MyxfwvbueUBynYHfQsutNXZNqNozGiMnsG")
2525
2626 let keyEcosystemAddresses = "ecosystem_addresses"
2727
2828 let keyCharsBodyAmount = "chars_body_amount"
2929
3030 let keyCharsEyesAmount = "chars_eyes_amount"
3131
3232 let keyCharsMouthAmount = "chars_mouth_amount"
3333
3434 let keyCharsStatsTiersRanges = "chars_stats_tiers_ranges"
3535
3636 let keyCharsNaturalElemBonusRanges = "chars_natural_elem_bonus_ranges"
3737
38-let keyCharsNaturalLootsBonusRanges = "chars_natural_loots_bonus_ranges"
38+let keyCharsNaturalBattleBonusRanges = "chars_natural_battle_bonus_ranges"
3939
4040 let keyCharsNaturalGeneratingBonusRanges = "chars_natural_generating_bonus_ranges"
4141
4242 func invokeChecks (callerAddr) = if ((isDataStorageUntouched(govApp) != false))
4343 then throw("Governing app not ready")
4444 else {
4545 let ecosystemAddresses = getStringValue(govApp, keyEcosystemAddresses)
4646 if ((contains(ecosystemAddresses, toString(callerAddr)) != false))
4747 then throw("Access denied")
4848 else true
4949 }
5050
5151
5252 func with (a,b) = {
5353 let c = match b {
5454 case isInt: Int =>
5555 toString(isInt)
5656 case isStr: String =>
5757 isStr
5858 case _ =>
5959 throw("Matching issue in with function")
6060 }
6161 ((c + separator) + a)
6262 }
6363
6464
6565 func randInt (min,max,txId,nonce) = {
6666 let hash = value(sha256_16Kb(((value(value(blockInfoByHeight(height)).vrf) + txId) + toBytes(nonce))))
6767 value(((value(toInt(hash)) % ((max - min) + 1)) + min))
6868 }
6969
7070
7171 func genRandomNaturalBonus (statsTierRanges,bonusRanges,startingNonce,txId) = {
7272 let sT1 = parseIntValue(statsTierRanges[0])
7373 let sT2 = parseIntValue(statsTierRanges[1])
7474 let sT3 = parseIntValue(statsTierRanges[2])
7575 let sT4 = parseIntValue(statsTierRanges[3])
7676 let sT5 = parseIntValue(statsTierRanges[4])
7777 let sT6 = parseIntValue(statsTierRanges[5])
7878 let bT1 = parseIntValue(bonusRanges[0])
7979 let bT2 = parseIntValue(bonusRanges[1])
8080 let bT3 = parseIntValue(bonusRanges[2])
8181 let bT4 = parseIntValue(bonusRanges[3])
8282 let bT5 = parseIntValue(bonusRanges[4])
8383 let bT6 = parseIntValue(bonusRanges[5])
8484 let tierResult = randInt(0, 10000, txId, startingNonce)
85- if (if ((tierResult >= 0))
86- then (sT1 >= tierResult)
87- else false)
85+ if ((sT1 >= tierResult))
8886 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))
9288 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))
9690 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))
10092 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))
10494 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))
11096 }
11197
11298
11399 @Callable(i)
114100 func createChar () = if ((invokeChecks(i.caller) != true))
115101 then throw()
116102 else {
117103 let txId = i.transactionId
118104 let callerAddr = toBase58String(i.caller.bytes)
119105 let charId = valueOrElse(getInteger(this, keyCharsCount), 1)
120106 let bodiesAmount = getIntegerValue(govApp, keyCharsBodyAmount)
121107 let eyesAmount = getIntegerValue(govApp, keyCharsEyesAmount)
122108 let mouthsAmount = getIntegerValue(govApp, keyCharsMouthAmount)
123109 let statsTiersRanges = split(getStringValue(govApp, keyCharsStatsTiersRanges), separator)
124110 let natElemBonusRanges = split(getStringValue(govApp, keyCharsNaturalElemBonusRanges), separator)
125- let natLootsBonusRanges = split(getStringValue(govApp, keyCharsNaturalLootsBonusRanges), separator)
111+ let natBattleBonusRanges = split(getStringValue(govApp, keyCharsNaturalBattleBonusRanges), separator)
126112 let natGeneratingBonusRanges = split(getStringValue(govApp, keyCharsNaturalGeneratingBonusRanges), separator)
127113 let appearance = makeString([toString(randInt(1, bodiesAmount, txId, 0)), toString(randInt(1, eyesAmount, txId, 1)), toString(randInt(1, mouthsAmount, txId, 2))], separator)
128114 let natPyroBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 3, txId)
129115 let natAquaBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 10, txId)
130116 let natTerraBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 17, txId)
131117 let natAeroBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 24, txId)
132118 let natGeneratingBonus = genRandomNaturalBonus(statsTiersRanges, natGeneratingBonusRanges, 31, txId)
133- let natLootsBonus = genRandomNaturalBonus(statsTiersRanges, natLootsBonusRanges, 38, txId)
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(keyNaturalLootsBonus, charId), natLootsBonus), IntegerEntry(with(keyNaturalGeneratingBonus, charId), natGeneratingBonus), IntegerEntry(keyCharsCount, (charId + 1))]
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))]
135121 }
136122
137123
138124 @Verifier(tx)
139125 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
140126

github/deemru/w8io/169f3d6 
43.71 ms