tx · 4v2sTWWE6eWicKiGtzK46j5qao16bktZKRgrVPYToURs

3NA3LRSigk6knLZ16uTzcdLNow2EQZtXTaJ:  -0.01400000 Waves

2022.05.18 12:47 [2056937] smart account 3NA3LRSigk6knLZ16uTzcdLNow2EQZtXTaJ > SELF 0.00000000 Waves

{ "type": 13, "id": "4v2sTWWE6eWicKiGtzK46j5qao16bktZKRgrVPYToURs", "fee": 1400000, "feeAssetId": null, "timestamp": 1652867264255, "version": 2, "chainId": 84, "sender": "3NA3LRSigk6knLZ16uTzcdLNow2EQZtXTaJ", "senderPublicKey": "ApEZSyUFWsckB3mZSWm3spfm6UPyDhMdrpxNhydohYs1", "proofs": [ "BSqUw9Hye8rno8F2j6D1zbgc7CZDtrhBKpQBxwETnQj8SZKFz5dibQze3CJqMa6knECp85W6KT2aD5VWtGVzfnv" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAAFwAAAAAJc2VwYXJhdG9yAgAAAAFfAAAAAA1rZXlDaGFyc0NvdW50AgAAAAtjaGFyc19jb3VudAAAAAAIa2V5T3duZXICAAAABW93bmVyAAAAAA1rZXlBcHBlYXJhbmNlAgAAAAphcHBlYXJhbmNlAAAAABNrZXlOYXR1cmFsUHlyb0JvbnVzAgAAABJuYXR1cmFsX3B5cm9fYm9udXMAAAAAE2tleU5hdHVyYWxBcXVhQm9udXMCAAAAEm5hdHVyYWxfYXF1YV9ib251cwAAAAAUa2V5TmF0dXJhbFRlcnJhQm9udXMCAAAAE25hdHVyYWxfdGVycmFfYm9udXMAAAAAE2tleU5hdHVyYWxBZXJvQm9udXMCAAAAEm5hdHVyYWxfYWVyb19ib251cwAAAAAUa2V5TmF0dXJhbExvb3RzQm9udXMCAAAAE25hdHVyYWxfbG9vdHNfYm9udXMAAAAAGWtleU5hdHVyYWxHZW5lcmF0aW5nQm9udXMCAAAAGG5hdHVyYWxfZ2VuZXJhdGluZ19ib251cwAAAAAGZ292QXBwCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAAB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FCb251cwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkBAAAABHdpdGgAAAACBQAAABNrZXlOYXR1cmFsQWVyb0JvbnVzBQAAAAZjaGFySWQFAAAADG5hdEFlcm9Cb251cwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkBAAAABHdpdGgAAAACBQAAABRrZXlOYXR1cmFsTG9vdHNCb251cwUAAAAGY2hhcklkBQAAAA1uYXRMb290c0JvbnVzCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQEAAAAEd2l0aAAAAAIFAAAAGWtleU5hdHVyYWxHZW5lcmF0aW5nQm9udXMFAAAABmNoYXJJZAUAAAASbmF0R2VuZXJhdGluZ0JvbnVzCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAA1rZXlDaGFyc0NvdW50CQAAZAAAAAIFAAAABmNoYXJJZAAAAAAAAAAAAQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXk8kZDQ", "height": 2056937, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: E1wS6nSTx4FKYUCbv3JNMwYumLTuNcgLWbm6nr4HwkMo Next: EH6F1nYWZQHZZXjnwRsM9abBC79iw7zqgFtdv48bLezg Diff:
OldNewDifferences
99
1010 let keyAppearance = "appearance"
1111
12-let keyPyroBonus = "pyro_bonus"
12+let keyNaturalPyroBonus = "natural_pyro_bonus"
1313
14-let keyAquaBonus = "aqua_bonus"
14+let keyNaturalAquaBonus = "natural_aqua_bonus"
1515
16-let keyTerraBonus = "terra_bonus"
16+let keyNaturalTerraBonus = "natural_terra_bonus"
1717
18-let keyAeroBonus = "aero_bonus"
18+let keyNaturalAeroBonus = "natural_aero_bonus"
1919
20-let keyLootsBonus = "loots_bonus"
20+let keyNaturalLootsBonus = "natural_loots_bonus"
2121
22-let keyGeneratingBonus = "generating_bonus"
22+let keyNaturalGeneratingBonus = "natural_generating_bonus"
2323
24-let govAddr = addressFromStringValue("3MyxfwvbueUBynYHfQsutNXZNqNozGiMnsG")
24+let govApp = addressFromStringValue("3MyxfwvbueUBynYHfQsutNXZNqNozGiMnsG")
2525
2626 let keyEcosystemAddresses = "ecosystem_addresses"
2727
28-let keyCharsBodiesAmount = "chars_bodies_amount"
28+let keyCharsBodyAmount = "chars_body_amount"
2929
3030 let keyCharsEyesAmount = "chars_eyes_amount"
3131
32-let keyCharsMouthsAmount = "chars_mouths_amount"
32+let keyCharsMouthAmount = "chars_mouth_amount"
3333
3434 let keyCharsStatsTiersRanges = "chars_stats_tiers_ranges"
3535
3939
4040 let keyCharsNaturalGeneratingBonusRanges = "chars_natural_generating_bonus_ranges"
4141
42-func invokChecks (callerAddr) = if ((isDataStorageUntouched(govAddr) != false))
42+func invokeChecks (callerAddr) = if ((isDataStorageUntouched(govApp) != false))
4343 then throw("Governing app not ready")
4444 else {
45- let ecosystemAddresses = getStringValue(govAddr, keyEcosystemAddresses)
45+ let ecosystemAddresses = getStringValue(govApp, keyEcosystemAddresses)
4646 if ((contains(ecosystemAddresses, toString(callerAddr)) != false))
4747 then throw("Access denied")
48- else unit
48+ else true
4949 }
50+
51+
52+func with (a,b) = {
53+ let c = match b {
54+ case isInt: Int =>
55+ toString(isInt)
56+ case isStr: String =>
57+ isStr
58+ case _ =>
59+ throw("Matching issue in with function")
60+ }
61+ ((c + separator) + a)
62+ }
5063
5164
5265 func randInt (min,max,txId,nonce) = {
5568 }
5669
5770
58-func with (a,b) = ((toString(b) + separator) + a)
59-
60-
61-func getRandomBonus (statsTierRanges,bonusRanges,startingNonce,txId) = {
71+func genRandomNaturalBonus (statsTierRanges,bonusRanges,startingNonce,txId) = {
6272 let sT1 = parseIntValue(statsTierRanges[0])
6373 let sT2 = parseIntValue(statsTierRanges[1])
6474 let sT3 = parseIntValue(statsTierRanges[2])
101111
102112
103113 @Callable(i)
104-func createChar () = valueOrElse(invokChecks(i.caller), {
105- let txId = i.transactionId
106- let callerAddr = toBase58String(i.caller.bytes)
107- let charId = valueOrElse(getInteger(this, keyCharsCount), 1)
108- let bodiesAmount = getIntegerValue(govAddr, keyCharsBodiesAmount)
109- let eyesAmount = getIntegerValue(govAddr, keyCharsEyesAmount)
110- let mouthsAmount = getIntegerValue(govAddr, keyCharsMouthsAmount)
111- let statsTiersRanges = split(getStringValue(govAddr, keyCharsStatsTiersRanges), separator)
112- let elemBonusRanges = split(getStringValue(govAddr, keyCharsNaturalElemBonusRanges), separator)
113- let lootsBonusRanges = split(getStringValue(govAddr, keyCharsNaturalLootsBonusRanges), separator)
114- let generatingBonusRanges = split(getStringValue(govAddr, keyCharsNaturalGeneratingBonusRanges), separator)
115- let appearance = makeString([toString(randInt(1, bodiesAmount, txId, 0)), toString(randInt(1, eyesAmount, txId, 1)), toString(randInt(1, mouthsAmount, txId, 2))], separator)
116- let pyroBonus = getRandomBonus(statsTiersRanges, elemBonusRanges, 3, txId)
117- let aquaBonus = getRandomBonus(statsTiersRanges, elemBonusRanges, 10, txId)
118- let terraBonus = getRandomBonus(statsTiersRanges, elemBonusRanges, 17, txId)
119- let aeroBonus = getRandomBonus(statsTiersRanges, elemBonusRanges, 24, txId)
120- let generatingBonus = getRandomBonus(statsTiersRanges, generatingBonusRanges, 31, txId)
121- let lootsBonus = getRandomBonus(statsTiersRanges, lootsBonusRanges, 38, txId)
122-[StringEntry(with(keyOwner, charId), callerAddr), StringEntry(with(keyAppearance, charId), appearance), IntegerEntry(with(keyPyroBonus, charId), pyroBonus), IntegerEntry(with(keyAquaBonus, charId), aquaBonus), IntegerEntry(with(keyTerraBonus, charId), terraBonus), IntegerEntry(with(keyAeroBonus, charId), aeroBonus), IntegerEntry(with(keyLootsBonus, charId), lootsBonus), IntegerEntry(with(keyGeneratingBonus, charId), generatingBonus), IntegerEntry(keyCharsCount, (charId + 1))]
123- })
114+func createChar () = if ((invokeChecks(i.caller) != true))
115+ then throw()
116+ else {
117+ let txId = i.transactionId
118+ let callerAddr = toBase58String(i.caller.bytes)
119+ let charId = valueOrElse(getInteger(this, keyCharsCount), 1)
120+ let bodiesAmount = getIntegerValue(govApp, keyCharsBodyAmount)
121+ let eyesAmount = getIntegerValue(govApp, keyCharsEyesAmount)
122+ let mouthsAmount = getIntegerValue(govApp, keyCharsMouthAmount)
123+ let statsTiersRanges = split(getStringValue(govApp, keyCharsStatsTiersRanges), separator)
124+ let natElemBonusRanges = split(getStringValue(govApp, keyCharsNaturalElemBonusRanges), separator)
125+ let natLootsBonusRanges = split(getStringValue(govApp, keyCharsNaturalLootsBonusRanges), separator)
126+ let natGeneratingBonusRanges = split(getStringValue(govApp, keyCharsNaturalGeneratingBonusRanges), separator)
127+ let appearance = makeString([toString(randInt(1, bodiesAmount, txId, 0)), toString(randInt(1, eyesAmount, txId, 1)), toString(randInt(1, mouthsAmount, txId, 2))], separator)
128+ let natPyroBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 3, txId)
129+ let natAquaBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 10, txId)
130+ let natTerraBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 17, txId)
131+ let natAeroBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 24, txId)
132+ 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))]
135+ }
124136
125137
126138 @Verifier(tx)
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
12-let keyPyroBonus = "pyro_bonus"
12+let keyNaturalPyroBonus = "natural_pyro_bonus"
1313
14-let keyAquaBonus = "aqua_bonus"
14+let keyNaturalAquaBonus = "natural_aqua_bonus"
1515
16-let keyTerraBonus = "terra_bonus"
16+let keyNaturalTerraBonus = "natural_terra_bonus"
1717
18-let keyAeroBonus = "aero_bonus"
18+let keyNaturalAeroBonus = "natural_aero_bonus"
1919
20-let keyLootsBonus = "loots_bonus"
20+let keyNaturalLootsBonus = "natural_loots_bonus"
2121
22-let keyGeneratingBonus = "generating_bonus"
22+let keyNaturalGeneratingBonus = "natural_generating_bonus"
2323
24-let govAddr = addressFromStringValue("3MyxfwvbueUBynYHfQsutNXZNqNozGiMnsG")
24+let govApp = addressFromStringValue("3MyxfwvbueUBynYHfQsutNXZNqNozGiMnsG")
2525
2626 let keyEcosystemAddresses = "ecosystem_addresses"
2727
28-let keyCharsBodiesAmount = "chars_bodies_amount"
28+let keyCharsBodyAmount = "chars_body_amount"
2929
3030 let keyCharsEyesAmount = "chars_eyes_amount"
3131
32-let keyCharsMouthsAmount = "chars_mouths_amount"
32+let keyCharsMouthAmount = "chars_mouth_amount"
3333
3434 let keyCharsStatsTiersRanges = "chars_stats_tiers_ranges"
3535
3636 let keyCharsNaturalElemBonusRanges = "chars_natural_elem_bonus_ranges"
3737
3838 let keyCharsNaturalLootsBonusRanges = "chars_natural_loots_bonus_ranges"
3939
4040 let keyCharsNaturalGeneratingBonusRanges = "chars_natural_generating_bonus_ranges"
4141
42-func invokChecks (callerAddr) = if ((isDataStorageUntouched(govAddr) != false))
42+func invokeChecks (callerAddr) = if ((isDataStorageUntouched(govApp) != false))
4343 then throw("Governing app not ready")
4444 else {
45- let ecosystemAddresses = getStringValue(govAddr, keyEcosystemAddresses)
45+ let ecosystemAddresses = getStringValue(govApp, keyEcosystemAddresses)
4646 if ((contains(ecosystemAddresses, toString(callerAddr)) != false))
4747 then throw("Access denied")
48- else unit
48+ else true
4949 }
50+
51+
52+func with (a,b) = {
53+ let c = match b {
54+ case isInt: Int =>
55+ toString(isInt)
56+ case isStr: String =>
57+ isStr
58+ case _ =>
59+ throw("Matching issue in with function")
60+ }
61+ ((c + separator) + a)
62+ }
5063
5164
5265 func randInt (min,max,txId,nonce) = {
5366 let hash = value(sha256_16Kb(((value(value(blockInfoByHeight(height)).vrf) + txId) + toBytes(nonce))))
5467 value(((value(toInt(hash)) % ((max - min) + 1)) + min))
5568 }
5669
5770
58-func with (a,b) = ((toString(b) + separator) + a)
59-
60-
61-func getRandomBonus (statsTierRanges,bonusRanges,startingNonce,txId) = {
71+func genRandomNaturalBonus (statsTierRanges,bonusRanges,startingNonce,txId) = {
6272 let sT1 = parseIntValue(statsTierRanges[0])
6373 let sT2 = parseIntValue(statsTierRanges[1])
6474 let sT3 = parseIntValue(statsTierRanges[2])
6575 let sT4 = parseIntValue(statsTierRanges[3])
6676 let sT5 = parseIntValue(statsTierRanges[4])
6777 let sT6 = parseIntValue(statsTierRanges[5])
6878 let bT1 = parseIntValue(bonusRanges[0])
6979 let bT2 = parseIntValue(bonusRanges[1])
7080 let bT3 = parseIntValue(bonusRanges[2])
7181 let bT4 = parseIntValue(bonusRanges[3])
7282 let bT5 = parseIntValue(bonusRanges[4])
7383 let bT6 = parseIntValue(bonusRanges[5])
7484 let tierResult = randInt(0, 10000, txId, startingNonce)
7585 if (if ((tierResult >= 0))
7686 then (sT1 >= tierResult)
7787 else false)
7888 then randInt(0, bT1, txId, (startingNonce + 1))
7989 else if (if ((tierResult > sT1))
8090 then (sT2 >= tierResult)
8191 else false)
8292 then randInt((bT1 + 1), bT2, txId, (startingNonce + 2))
8393 else if (if ((tierResult > sT2))
8494 then (sT3 >= tierResult)
8595 else false)
8696 then randInt((bT2 + 1), bT3, txId, (startingNonce + 3))
8797 else if (if ((tierResult > sT3))
8898 then (sT4 >= tierResult)
8999 else false)
90100 then randInt((bT3 + 1), bT4, txId, (startingNonce + 4))
91101 else if (if ((tierResult > sT4))
92102 then (sT5 >= tierResult)
93103 else false)
94104 then randInt((bT4 + 1), bT5, txId, (startingNonce + 5))
95105 else if (if ((tierResult > sT5))
96106 then (sT6 >= tierResult)
97107 else false)
98108 then randInt((bT5 + 1), bT6, txId, (startingNonce + 6))
99109 else throw("Unexpected error")
100110 }
101111
102112
103113 @Callable(i)
104-func createChar () = valueOrElse(invokChecks(i.caller), {
105- let txId = i.transactionId
106- let callerAddr = toBase58String(i.caller.bytes)
107- let charId = valueOrElse(getInteger(this, keyCharsCount), 1)
108- let bodiesAmount = getIntegerValue(govAddr, keyCharsBodiesAmount)
109- let eyesAmount = getIntegerValue(govAddr, keyCharsEyesAmount)
110- let mouthsAmount = getIntegerValue(govAddr, keyCharsMouthsAmount)
111- let statsTiersRanges = split(getStringValue(govAddr, keyCharsStatsTiersRanges), separator)
112- let elemBonusRanges = split(getStringValue(govAddr, keyCharsNaturalElemBonusRanges), separator)
113- let lootsBonusRanges = split(getStringValue(govAddr, keyCharsNaturalLootsBonusRanges), separator)
114- let generatingBonusRanges = split(getStringValue(govAddr, keyCharsNaturalGeneratingBonusRanges), separator)
115- let appearance = makeString([toString(randInt(1, bodiesAmount, txId, 0)), toString(randInt(1, eyesAmount, txId, 1)), toString(randInt(1, mouthsAmount, txId, 2))], separator)
116- let pyroBonus = getRandomBonus(statsTiersRanges, elemBonusRanges, 3, txId)
117- let aquaBonus = getRandomBonus(statsTiersRanges, elemBonusRanges, 10, txId)
118- let terraBonus = getRandomBonus(statsTiersRanges, elemBonusRanges, 17, txId)
119- let aeroBonus = getRandomBonus(statsTiersRanges, elemBonusRanges, 24, txId)
120- let generatingBonus = getRandomBonus(statsTiersRanges, generatingBonusRanges, 31, txId)
121- let lootsBonus = getRandomBonus(statsTiersRanges, lootsBonusRanges, 38, txId)
122-[StringEntry(with(keyOwner, charId), callerAddr), StringEntry(with(keyAppearance, charId), appearance), IntegerEntry(with(keyPyroBonus, charId), pyroBonus), IntegerEntry(with(keyAquaBonus, charId), aquaBonus), IntegerEntry(with(keyTerraBonus, charId), terraBonus), IntegerEntry(with(keyAeroBonus, charId), aeroBonus), IntegerEntry(with(keyLootsBonus, charId), lootsBonus), IntegerEntry(with(keyGeneratingBonus, charId), generatingBonus), IntegerEntry(keyCharsCount, (charId + 1))]
123- })
114+func createChar () = if ((invokeChecks(i.caller) != true))
115+ then throw()
116+ else {
117+ let txId = i.transactionId
118+ let callerAddr = toBase58String(i.caller.bytes)
119+ let charId = valueOrElse(getInteger(this, keyCharsCount), 1)
120+ let bodiesAmount = getIntegerValue(govApp, keyCharsBodyAmount)
121+ let eyesAmount = getIntegerValue(govApp, keyCharsEyesAmount)
122+ let mouthsAmount = getIntegerValue(govApp, keyCharsMouthAmount)
123+ let statsTiersRanges = split(getStringValue(govApp, keyCharsStatsTiersRanges), separator)
124+ let natElemBonusRanges = split(getStringValue(govApp, keyCharsNaturalElemBonusRanges), separator)
125+ let natLootsBonusRanges = split(getStringValue(govApp, keyCharsNaturalLootsBonusRanges), separator)
126+ let natGeneratingBonusRanges = split(getStringValue(govApp, keyCharsNaturalGeneratingBonusRanges), separator)
127+ let appearance = makeString([toString(randInt(1, bodiesAmount, txId, 0)), toString(randInt(1, eyesAmount, txId, 1)), toString(randInt(1, mouthsAmount, txId, 2))], separator)
128+ let natPyroBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 3, txId)
129+ let natAquaBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 10, txId)
130+ let natTerraBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 17, txId)
131+ let natAeroBonus = genRandomNaturalBonus(statsTiersRanges, natElemBonusRanges, 24, txId)
132+ 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))]
135+ }
124136
125137
126138 @Verifier(tx)
127139 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
128140

github/deemru/w8io/169f3d6 
35.54 ms