tx · H7ZvmpTSvZN6uH3TDXDNmQx13EQjhZCrLSCGFNnKx9KY

3NAoJSThEgz12iLrRFSeMZpP1mEYc4QcGa3:  -0.01000000 Waves

2023.12.07 14:33 [2876177] smart account 3NAoJSThEgz12iLrRFSeMZpP1mEYc4QcGa3 > SELF 0.00000000 Waves

{ "type": 13, "id": "H7ZvmpTSvZN6uH3TDXDNmQx13EQjhZCrLSCGFNnKx9KY", "fee": 1000000, "feeAssetId": null, "timestamp": 1701948799893, "version": 2, "chainId": 84, "sender": "3NAoJSThEgz12iLrRFSeMZpP1mEYc4QcGa3", "senderPublicKey": "5TXMdPyvDNfxhdixe86fk7Ya8FScpZGfZ6XNawu8sYK4", "proofs": [ "5vCHvLnuyouKuWLGtKPkD42v5AfGjinAwW4XWcpNyzcWrhQ6iPKqmZbQqRFueJvboX4524FWsDg1hyS4nxdggKUT" ], "script": "base64:BgIWCAISBwoFEREICAESAwoBCBIECgIIAQcAC0JBSV9BRERSRVNTAiMzTjl0S2l4enFUWVduRVhReHJEUTVwQlRHdlFkNnNGc3ZtVgAEVFlQRQIPY3Jhc2hFdmFsdWF0aW9uAAdCQUlfRkVFAICt4gQAEUFJX1RPS0VOX0FTU0VUX0lEASCT4XI4cQSbauiaYx8EJLdkU5csPrxmC4N0r2i7JI3iQgASVVNEX1RPS0VOX0FTU0VUX0lEASD0y7xo+2oaYWIjSL66wV175dmB7kJoGRUhLW0SJ79srAELcmVtb3ZlTWFya3MBC21hcmtzU3RyaW5nBAFhCQCwAgIFC21hcmtzU3RyaW5nAAEEAWIJALMCAgUBYQABBQFiAQlwYXJzZUpzb24BBGpzb24EDG1vZGlmaWVkSnNvbgkAsAICBQRqc29uAAEEDW1vZGlmaWVkSnNvbjIJALMCAgUMbW9kaWZpZWRKc29uAAEEBnNwbGl0MQkAtQkCBQ1tb2RpZmllZEpzb24yAgEsBAlrZXlWYWx1ZTEJALUJAgkAkQMCBQZzcGxpdDEAAAIBOgQEa2V5MQkBC3JlbW92ZU1h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AAIBQJ0eA9zZW5kZXJQdWJsaWNLZXl4a+oY", "height": 2876177, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2mQu1Zd2j7zagJ7sL7S2gLTmTpoTfXAQvGWiFMtfg9h2 Next: none Diff:
OldNewDifferences
88 let BAI_FEE = 10000000
99
1010 let AI_TOKEN_ASSET_ID = base58'AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1'
11+
12+let USD_TOKEN_ASSET_ID = base58'HUafUdHNmuLduuDkXiR7n6WA3LYf8rY2ySFbjkPWENV9'
1113
1214 func removeMarks (marksString) = {
1315 let a = drop(marksString, 1)
9395 case s: Int =>
9496 s
9597 case _ =>
96- "No data Found"
98+ -404
9799 }
98- if ((costEstimationOfInnocentPerson == "No data Found"))
100+ if ((costEstimationOfInnocentPerson == -404))
99101 then throw("There is no cost data for this address!")
100102 else if ((costEstimationOfInnocentPerson == -1))
101103 then [StringEntry((crashId + "_eval"), txId), StringEntry((crashId + "_innocent_address"), innocentAddress), StringEntry((crashId + "_guilty_address"), guiltyAddress), StringEntry((crashId + "_status"), "evaluated")]
102- else [StringEntry((crashId + "_eval"), txId), StringEntry((crashId + "_innocent_address"), innocentAddress), StringEntry((crashId + "_guilty_address"), guiltyAddress), StringEntry((crashId + "_status"), "closed"), ScriptTransfer(Address(fromBase58String(innocentAddress)), 100000000, unit)]
104+ else [StringEntry((crashId + "_eval"), txId), StringEntry((crashId + "_innocent_address"), innocentAddress), StringEntry((crashId + "_guilty_address"), guiltyAddress), StringEntry((crashId + "_status"), "closed"), ScriptTransfer(Address(fromBase58String(innocentAddress)), costEstimationOfInnocentPerson, USD_TOKEN_ASSET_ID)]
103105 }
104106 }
105107 }
131133 then throw("There is no eligible person for this case!")
132134 else if ((eligible_address != sender))
133135 then throw("You are not allowed to request a payout!")
134- else [IntegerEntry((((crashId + "_") + sender) + "_cost"), amount), StringEntry((crashId + "_status"), "closed"), ScriptTransfer(Address(fromBase58String(sender)), 100000000, unit)]
136+ else [IntegerEntry((((crashId + "_") + sender) + "_cost"), amount), StringEntry((crashId + "_status"), "closed"), ScriptTransfer(Address(fromBase58String(sender)), amount, USD_TOKEN_ASSET_ID)]
135137 }
136138 }
137139
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let BAI_ADDRESS = "3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV"
55
66 let TYPE = "crashEvaluation"
77
88 let BAI_FEE = 10000000
99
1010 let AI_TOKEN_ASSET_ID = base58'AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1'
11+
12+let USD_TOKEN_ASSET_ID = base58'HUafUdHNmuLduuDkXiR7n6WA3LYf8rY2ySFbjkPWENV9'
1113
1214 func removeMarks (marksString) = {
1315 let a = drop(marksString, 1)
1416 let b = dropRight(a, 1)
1517 b
1618 }
1719
1820
1921 func parseJson (json) = {
2022 let modifiedJson = drop(json, 1)
2123 let modifiedJson2 = dropRight(modifiedJson, 1)
2224 let split1 = split(modifiedJson2, ",")
2325 let keyValue1 = split(split1[0], ":")
2426 let key1 = removeMarks(keyValue1[0])
2527 let value1 = removeMarks(keyValue1[1])
2628 let keyValue2 = split(split1[1], ":")
2729 let key2 = removeMarks(keyValue2[0])
2830 let value2 = removeMarks(keyValue2[1])
2931 let keyValue3 = split(split1[2], ":")
3032 let key3 = removeMarks(keyValue3[0])
3133 let value3 = removeMarks(keyValue3[1])
3234 $Tuple3([key1, value1], [key2, value2], [key3, value3])
3335 }
3436
3537
3638 @Callable(i)
3739 func registerData (clientInput,opponentInput,id,oppAddress,lgtCond) = {
3840 let searchForExistingData = match getString(id) {
3941 case s: String =>
4042 s
4143 case _ =>
4244 "no Data exists"
4345 }
4446 if ((searchForExistingData != "no Data exists"))
4547 then throw("There is already existing Data for this case!")
4648 else {
4749 let parameters = [id, TYPE, "evaluatedDataCallback"]
4850 let client = toString(i.caller)
4951 let txId = toBase58String(i.transactionId)
5052 if ((client == oppAddress))
5153 then throw("Forbidden: Sender address equals opponents address!")
5254 else {
5355 let invokeTask = invoke(Address(fromBase58String(BAI_ADDRESS)), "registerTaskCallback", parameters, [AttachedPayment(AI_TOKEN_ASSET_ID, BAI_FEE)])
5456 if ((invokeTask != invokeTask))
5557 then throw("Strict value is not equal to itself.")
5658 else [StringEntry(id, txId), IntegerEntry((((id + "_") + client) + "_age"), clientInput[0]), IntegerEntry((((id + "_") + client) + "_sex"), clientInput[1]), IntegerEntry((((id + "_") + client) + "_damage"), clientInput[2]), IntegerEntry((((id + "_") + client) + "_fac1"), clientInput[3]), IntegerEntry((((id + "_") + client) + "_fac2"), clientInput[4]), IntegerEntry((((id + "_") + client) + "_fac3"), clientInput[5]), IntegerEntry((((id + "_") + client) + "_fac4"), clientInput[6]), IntegerEntry((((id + "_") + client) + "_vio1"), clientInput[7]), IntegerEntry((((id + "_") + client) + "_vio2"), clientInput[8]), IntegerEntry((((id + "_") + client) + "_vio3"), clientInput[9]), IntegerEntry((((id + "_") + client) + "_vio4"), clientInput[10]), IntegerEntry((((id + "_") + client) + "_cost"), clientInput[11]), IntegerEntry((((id + "_") + oppAddress) + "_age"), opponentInput[0]), IntegerEntry((((id + "_") + oppAddress) + "_sex"), opponentInput[1]), IntegerEntry((((id + "_") + oppAddress) + "_damage"), opponentInput[2]), IntegerEntry((((id + "_") + oppAddress) + "_fac1"), opponentInput[3]), IntegerEntry((((id + "_") + oppAddress) + "_fac2"), opponentInput[4]), IntegerEntry((((id + "_") + oppAddress) + "_fac3"), opponentInput[5]), IntegerEntry((((id + "_") + oppAddress) + "_fac4"), opponentInput[6]), IntegerEntry((((id + "_") + oppAddress) + "_vio1"), opponentInput[7]), IntegerEntry((((id + "_") + oppAddress) + "_vio2"), opponentInput[8]), IntegerEntry((((id + "_") + oppAddress) + "_vio3"), opponentInput[9]), IntegerEntry((((id + "_") + oppAddress) + "_vio4"), opponentInput[10]), IntegerEntry((((id + "_") + oppAddress) + "_cost"), opponentInput[11]), IntegerEntry((id + "_lgt"), lgtCond), StringEntry((id + "_status"), "open"), StringEntry((id + "_sender"), client)]
5759 }
5860 }
5961 }
6062
6163
6264
6365 @Callable(i)
6466 func evaluatedDataCallback (response) = {
6567 let txId = toBase58String(i.transactionId)
6668 let parsedJson = parseJson(response)
6769 let crashId = parsedJson._1[1]
6870 let innocentAddress = parsedJson._2[1]
6971 let guiltyAddress = parsedJson._3[1]
7072 let RegisterTxId = match getString(crashId) {
7173 case s: String =>
7274 s
7375 case _ =>
7476 "no Data exists"
7577 }
7678 if ((RegisterTxId == "no Data exists"))
7779 then throw("There is no Data for this crashId!")
7880 else {
7981 let status = match getString((crashId + "_status")) {
8082 case s: String =>
8183 s
8284 case _ =>
8385 "no Data exists"
8486 }
8587 if ((status == "no Data exists"))
8688 then throw("There is no status for this case!")
8789 else if ((status == "closed"))
8890 then throw("A case should not be payed out twice!")
8991 else if ((status == "evaluated"))
9092 then throw("A case should not be evaluated twice!")
9193 else {
9294 let costEstimationOfInnocentPerson = match getInteger((((crashId + "_") + innocentAddress) + "_cost")) {
9395 case s: Int =>
9496 s
9597 case _ =>
96- "No data Found"
98+ -404
9799 }
98- if ((costEstimationOfInnocentPerson == "No data Found"))
100+ if ((costEstimationOfInnocentPerson == -404))
99101 then throw("There is no cost data for this address!")
100102 else if ((costEstimationOfInnocentPerson == -1))
101103 then [StringEntry((crashId + "_eval"), txId), StringEntry((crashId + "_innocent_address"), innocentAddress), StringEntry((crashId + "_guilty_address"), guiltyAddress), StringEntry((crashId + "_status"), "evaluated")]
102- else [StringEntry((crashId + "_eval"), txId), StringEntry((crashId + "_innocent_address"), innocentAddress), StringEntry((crashId + "_guilty_address"), guiltyAddress), StringEntry((crashId + "_status"), "closed"), ScriptTransfer(Address(fromBase58String(innocentAddress)), 100000000, unit)]
104+ else [StringEntry((crashId + "_eval"), txId), StringEntry((crashId + "_innocent_address"), innocentAddress), StringEntry((crashId + "_guilty_address"), guiltyAddress), StringEntry((crashId + "_status"), "closed"), ScriptTransfer(Address(fromBase58String(innocentAddress)), costEstimationOfInnocentPerson, USD_TOKEN_ASSET_ID)]
103105 }
104106 }
105107 }
106108
107109
108110
109111 @Callable(i)
110112 func requestPayout (crashId,amount) = {
111113 let sender = toString(i.caller)
112114 let txId = toBase58String(i.transactionId)
113115 let status = match getString((crashId + "_status")) {
114116 case s: String =>
115117 s
116118 case _ =>
117119 "no Data exists"
118120 }
119121 if ((status == "no Data exists"))
120122 then throw("There is no status for this case!")
121123 else if ((status != "evaluated"))
122124 then throw("Only cases with evaluated status can request a payout!")
123125 else {
124126 let eligible_address = match getString((crashId + "_innocent_address")) {
125127 case s: String =>
126128 s
127129 case _ =>
128130 "no Data exists"
129131 }
130132 if ((status == "no Data exists"))
131133 then throw("There is no eligible person for this case!")
132134 else if ((eligible_address != sender))
133135 then throw("You are not allowed to request a payout!")
134- else [IntegerEntry((((crashId + "_") + sender) + "_cost"), amount), StringEntry((crashId + "_status"), "closed"), ScriptTransfer(Address(fromBase58String(sender)), 100000000, unit)]
136+ else [IntegerEntry((((crashId + "_") + sender) + "_cost"), amount), StringEntry((crashId + "_status"), "closed"), ScriptTransfer(Address(fromBase58String(sender)), amount, USD_TOKEN_ASSET_ID)]
135137 }
136138 }
137139
138140
139141 @Verifier(tx)
140142 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
141143

github/deemru/w8io/026f985 
35.62 ms