tx · CYQ2oFCXEVoX9JPtRQ7N1q1Jb6mrWBio9NB5f9rCBiRT

3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV:  -0.05000000 Waves

2023.06.09 18:40 [2615321] smart account 3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV > SELF 0.00000000 Waves

{ "type": 13, "id": "CYQ2oFCXEVoX9JPtRQ7N1q1Jb6mrWBio9NB5f9rCBiRT", "fee": 5000000, "feeAssetId": null, "timestamp": 1686325297903, "version": 2, "chainId": 84, "sender": "3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV", "senderPublicKey": "DS6HkopS9zypvxX6VhkdNvv6v4wcPZuChRvTwKJeacxE", "proofs": [ "3eDVpqHEuhvdfc7WJaY5GG9anbryrjkPL1YBCDsoX2ekxQYQ8vTFRUZeEAT1nikUDPm2fuUYnQZkqfHBQQUq3Y6L" ], "script": "base64:BgISCAISAwoBCBIDCgEIEgQKAggIDAARQUlfVE9LRU5fQVNTRVRfSUQBIJPhcjhxBJtq6JpjHwQkt2RTlyw+vGYLg3SvaLskjeJCAAtTVEFUVVNfT1BFTgIEb3BlbgASU1RBVFVTX0NIRUNLRURfT1VUAgtjaGVja2VkX291dAALU1RBVFVTX0RPTkUCBGRvbmUADkNIRUNLRURfT1VUX0JZAg9fY2hlY2tlZF9vdXRfYnkAE1NJTVBMRV9DSEFUR1BUX1RBU0sCE3NpbXBsZV9DaGF0R1BUX3Rhc2sAEENIRUNLX09VVF9IRUlHSFQCEV9jaGVja19vdXRfaGVpZ2h0AA9SRUdJU1RFUl9IRUlHSFQCEF9yZWdpc3Rlcl9oZWlnaHQADUNPTU1JVF9IRUlHSFQCDl9jb21taXRfaGVpZ2h0AQ9jYW5CZUNoZWNrZWRPdXQBBnRhc2tJZAQGc3RhdHVzCQCdCAIFBHRoaXMJAKwCAgUGdGFza0lkAgdfc3RhdHVzCQAAAgUGc3RhdHVzBQtTVEFUVVNfT1BFTgEOaXNDb3JyZWN0QW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8DqcgpDDGSsvhaA Next: 87FwFz1XyTnm3U5d6WtNMByhHVRCyoVwRDre3CrtrspN Diff:
OldNewDifferences
7777 let timestamp = lastBlock.timestamp
7878 if (!(taskStillOpen))
7979 then throw("Task not open for checkout!")
80- 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))]
80+ 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_chatgpt_" + taskId))]
8181 }
8282
8383
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 = "simple_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 = toBase58String(i.callerPublicKey)
5757 let txId = toBase58String(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!")
6767 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_chatgpt_" + taskId), true)]
6868 }
6969 }
7070
7171
7272
7373 @Callable(i)
7474 func checkoutChatGPTTask (taskId) = {
7575 let callerPublicKey = toBase58String(i.callerPublicKey)
7676 let taskStillOpen = canBeCheckedOut(taskId)
7777 let timestamp = lastBlock.timestamp
7878 if (!(taskStillOpen))
7979 then throw("Task not open for checkout!")
80- 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))]
80+ 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_chatgpt_" + taskId))]
8181 }
8282
8383
8484
8585 @Callable(i)
8686 func commitChatGPTTask (taskId,response) = {
8787 let callerPublicKey = toBase58String(i.callerPublicKey)
8888 let correctAgent = isCorrectAgent(taskId, callerPublicKey)
8989 let timestamp = lastBlock.timestamp
9090 if (!(correctAgent))
9191 then throw("Task may only be submitted by the agent who checked the task out!")
9292 else [StringEntry((taskId + "_status"), STATUS_DONE), StringEntry((taskId + "_result"), response), IntegerEntry((taskId + COMMIT_HEIGHT), height), IntegerEntry((taskId + "_commit_timestamp"), timestamp)]
9393 }
9494
9595
9696 @Verifier(tx)
9797 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
9898

github/deemru/w8io/026f985 
26.13 ms