tx · xFHmzfUQPcoZ5B6hFrU74ZvzYtn1Qhh7Fd6jebNwY3j

3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV:  -0.05000000 Waves

2023.06.09 11:39 [2614907] smart account 3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV > SELF 0.00000000 Waves

{ "type": 13, "id": "xFHmzfUQPcoZ5B6hFrU74ZvzYtn1Qhh7Fd6jebNwY3j", "fee": 5000000, "feeAssetId": null, "timestamp": 1686299993040, "version": 2, "chainId": 84, "sender": "3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV", "senderPublicKey": "DS6HkopS9zypvxX6VhkdNvv6v4wcPZuChRvTwKJeacxE", "proofs": [ "3at4sjAeM1vCq8A7MSY8mWKbAgBWcMfqecycdZfhcoLAejrEaLPLgj2w11nXn9udyLUjv8mkm9Sn1UQW6VGahc4y" ], "script": "base64:BgISCAISAwoBCBIDCgEIEgQKAggIDAARQUlfVE9LRU5fQVNTRVRfSUQBIJPhcjhxBJtq6JpjHwQkt2RTlyw+vGYLg3SvaLskjeJCAAtTVEFUVVNfT1BFTgIEb3BlbgASU1RBVFVTX0NIRUNLRURfT1VUAgtjaGVja2VkX291dAALU1RBVFVTX0RPTkUCBGRvbmUADkNIRUNLRURfT1VUX0JZAg9fY2hlY2tlZF9vdXRfYnkAE1NJTVBMRV9DSEFUR1BUX1RBU0sCFHNpbWlwbGVfQ2hhdEdQVF90YXNrABBDSEVDS19PVVRfSEVJR0hUAhFfY2hlY2tfb3V0X2hlaWdodAAPUkVHSVNURVJfSEVJR0hUAhBfcmVnaXN0ZXJfaGVpZ2h0AA1DT01NSVRfSEVJR0hUAg5fY29tbWl0X2hlaWdodAEPY2FuQmVDaGVja2VkT3V0AQZ0YXNrSWQEBnN0YXR1cwkAnQgCBQR0aGlzCQCsAgIFBnRhc2tJZAIHX3N0YXR1cwkAAAIFBnN0YXR1cwULU1RBVFVTX09QRU4BDmlzQ29ycmVjdEFnZW50AgZ0Y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acted Prev: 5QieAPFibJjRStRtjoFYnsznM3J9AMo288W2GjskhD3q Next: F15DaJuwt6pvsydjQ8nFzmDu6xKXdemFADBNLtbUwLR4 Diff:
OldNewDifferences
6464 then throw("Payment only possible in the AI Token!")
6565 else if ((10000000 > fee))
6666 then throw("Payment needs to be at least 0.1 AI Token!")
67- else [StringEntry((taskId + "_description"), description), StringEntry((txId + "_initializer"), callerPublicKey), StringEntry((taskId + "_status"), STATUS_OPEN), StringEntry((taskId + "_type"), SIMPLE_CHATGPT_TASK), IntegerEntry((taskId + REGISTER_HEIGHT), height), IntegerEntry((taskId + "register_timestamp"), timestamp)]
67+ else [StringEntry((taskId + "_description"), description), StringEntry((txId + "_initializer"), callerPublicKey), StringEntry((taskId + "_status"), STATUS_OPEN), StringEntry((taskId + "_type"), SIMPLE_CHATGPT_TASK), IntegerEntry((taskId + REGISTER_HEIGHT), height), IntegerEntry((taskId + "register_timestamp"), timestamp), BooleanEntry(("open_" + taskId), true)]
6868 }
6969 }
7070
7878 let timestamp = lastBlock.timestamp
7979 if (!(taskStillOpen))
8080 then throw("Task not open for checkout!")
81- else [StringEntry((taskId + CHECKED_OUT_BY), callerPublicKey), StringEntry((taskId + "_status"), STATUS_CHECKED_OUT), IntegerEntry((taskId + CHECK_OUT_HEIGHT), height), IntegerEntry((taskId + "_check_out_timestamp"), timestamp)]
81+ else [StringEntry((taskId + CHECKED_OUT_BY), callerPublicKey), StringEntry((taskId + "_status"), STATUS_CHECKED_OUT), IntegerEntry((taskId + CHECK_OUT_HEIGHT), height), IntegerEntry((taskId + "_check_out_timestamp"), timestamp), DeleteEntry(("open_" + taskId))]
8282 }
8383
8484
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let AI_TOKEN_ASSET_ID = base58'AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1'
55
66 let STATUS_OPEN = "open"
77
88 let STATUS_CHECKED_OUT = "checked_out"
99
1010 let STATUS_DONE = "done"
1111
1212 let CHECKED_OUT_BY = "_checked_out_by"
1313
1414 let SIMPLE_CHATGPT_TASK = "simiple_ChatGPT_task"
1515
1616 let CHECK_OUT_HEIGHT = "_check_out_height"
1717
1818 let REGISTER_HEIGHT = "_register_height"
1919
2020 let COMMIT_HEIGHT = "_commit_height"
2121
2222 func canBeCheckedOut (taskId) = {
2323 let status = getString(this, (taskId + "_status"))
2424 (status == STATUS_OPEN)
2525 }
2626
2727
2828 func isCorrectAgent (taskId,agentId) = {
2929 let checkoutAgentId = getString(this, (taskId + CHECKED_OUT_BY))
3030 (checkoutAgentId == agentId)
3131 }
3232
3333
3434 func getTaskId (txId) = {
3535 let callerPublicKey = match getString(this, (txId + "_initializer")) {
3636 case str: String =>
3737 str
3838 case _ =>
3939 ""
4040 }
4141 match getString(this, ((txId + "_") + callerPublicKey)) {
4242 case str: String =>
4343 str
4444 case _ =>
4545 ""
4646 }
4747 }
4848
4949
5050 @Callable(i)
5151 func registerChatGPTTask (description) = {
5252 let numberOfPayments = size(i.payments)
5353 if ((numberOfPayments != 1))
5454 then throw("Payment necessary!")
5555 else {
5656 let callerPublicKey = toUtf8String(i.callerPublicKey)
5757 let txId = toUtf8String(i.transactionId)
5858 let payment = i.payments[0]
5959 let fee = payment.amount
6060 let feeAssetId = payment.assetId
6161 let taskId = ((txId + "_") + callerPublicKey)
6262 let timestamp = lastBlock.timestamp
6363 if ((feeAssetId != AI_TOKEN_ASSET_ID))
6464 then throw("Payment only possible in the AI Token!")
6565 else if ((10000000 > fee))
6666 then throw("Payment needs to be at least 0.1 AI Token!")
67- else [StringEntry((taskId + "_description"), description), StringEntry((txId + "_initializer"), callerPublicKey), StringEntry((taskId + "_status"), STATUS_OPEN), StringEntry((taskId + "_type"), SIMPLE_CHATGPT_TASK), IntegerEntry((taskId + REGISTER_HEIGHT), height), IntegerEntry((taskId + "register_timestamp"), timestamp)]
67+ else [StringEntry((taskId + "_description"), description), StringEntry((txId + "_initializer"), callerPublicKey), StringEntry((taskId + "_status"), STATUS_OPEN), StringEntry((taskId + "_type"), SIMPLE_CHATGPT_TASK), IntegerEntry((taskId + REGISTER_HEIGHT), height), IntegerEntry((taskId + "register_timestamp"), timestamp), BooleanEntry(("open_" + taskId), true)]
6868 }
6969 }
7070
7171
7272
7373 @Callable(i)
7474 func checkoutChatGPTTask (txId) = {
7575 let taskId = getTaskId(txId)
7676 let callerPublicKey = toUtf8String(i.callerPublicKey)
7777 let taskStillOpen = canBeCheckedOut(taskId)
7878 let timestamp = lastBlock.timestamp
7979 if (!(taskStillOpen))
8080 then throw("Task not open for checkout!")
81- else [StringEntry((taskId + CHECKED_OUT_BY), callerPublicKey), StringEntry((taskId + "_status"), STATUS_CHECKED_OUT), IntegerEntry((taskId + CHECK_OUT_HEIGHT), height), IntegerEntry((taskId + "_check_out_timestamp"), timestamp)]
81+ else [StringEntry((taskId + CHECKED_OUT_BY), callerPublicKey), StringEntry((taskId + "_status"), STATUS_CHECKED_OUT), IntegerEntry((taskId + CHECK_OUT_HEIGHT), height), IntegerEntry((taskId + "_check_out_timestamp"), timestamp), DeleteEntry(("open_" + taskId))]
8282 }
8383
8484
8585
8686 @Callable(i)
8787 func commitChatGPTTask (txId,response) = {
8888 let taskId = getTaskId(txId)
8989 let callerPublicKey = toUtf8String(i.callerPublicKey)
9090 let correctAgent = isCorrectAgent(taskId, callerPublicKey)
9191 let timestamp = lastBlock.timestamp
9292 if (!(correctAgent))
9393 then throw("Task may only be submitted by the agent who checked the task out!")
9494 else [StringEntry((taskId + "_status"), STATUS_DONE), StringEntry((taskId + "_result"), response), IntegerEntry((taskId + COMMIT_HEIGHT), height), IntegerEntry((taskId + "_commit_timestamp"), timestamp)]
9595 }
9696
9797
9898 @Verifier(tx)
9999 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
100100

github/deemru/w8io/026f985 
31.27 ms