tx · 5qQ85zpAxSyB9afHreKfKtpygPHHzkuYvHCzDnQjMMA4

3MxW2aG6PcdZeNjj1DuzGSbmWoy2BDvmtSD:  -0.05000000 Waves

2024.10.28 10:25 [3346420] smart account 3MxW2aG6PcdZeNjj1DuzGSbmWoy2BDvmtSD > SELF 0.00000000 Waves

{ "type": 13, "id": "5qQ85zpAxSyB9afHreKfKtpygPHHzkuYvHCzDnQjMMA4", "fee": 5000000, "feeAssetId": null, "timestamp": 1730100349899, "version": 2, "chainId": 84, "sender": "3MxW2aG6PcdZeNjj1DuzGSbmWoy2BDvmtSD", "senderPublicKey": "HtED8Ks6yPKYzEnXYAoLvskVyZuFW3YcZH8JF5NWbMvb", "proofs": [ "3W7ymo36akv2cHRadXQV1VsN44uaTR2cn9PY4FVHuAzN3XGDYBMNFxERiuwGuPfg3WKCns4FzJHjSyBYtGqstGjL" ], "script": "base64:AAIFAAAAAAAAAA4IAhIECgIICBIECgIICAAAAAMAAAAAF0JBSV9DT05UUkFDVF9QVUJMSUNfS0VZAQAAACC4ub5WQ6dKmSY4XOD0ENHA5nSTpo3ZXmT/mOT2RZ2+BwAAAAAMQkFJX0NPTlRSQUNUCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABBQAAABdCQUlfQ09OVFJBQ1RfUFVCTElDX0tFWQAAAAAMQkFJX0FTU0VUX0lEAQAAACCT4XI4cQSbauiaYx8EJLdkU5csPrxmC4N0r2i7JI3iQgAAAAIAAAABaQEAAAAQZ2V0QW5zd2VyRm9yQ2hhdAAAAAIAAAAGY2hhdElkAAAAA2NpZAQAAAAQbnVtYmVyT2ZQYXltZW50cwkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwMJAQAAAAIhPQAAAAIFAAAAEG51bWJlck9mUGF5bWVudHMAAAAAAAAAAAEJAAACAAAAAQIAAAASUGF5bWVudCBuZWNlc3NhcnkhBAAAAAdwYXltZW50CQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAA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AgAAAAECAAAAE05vIGluaXRpYXRvciBmb3VuZCEEAAAACXRpbWVzdGFtcAkAAaQAAAABCAUAAAAJbGFzdEJsb2NrAAAACXRpbWVzdGFtcAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIFAAAABmNoYXRJZAIAAAAHX2xhdGVzdAUAAAADY2lkCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgUAAAAGY2hhdElkAgAAAAdfc3RhdHVzAgAAAARkb25lCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACBQAAAAlwdWJsaWNLZXkCAAAAAV8FAAAABmNoYXRJZAkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAANjaWQCAAAAAV8FAAAACXRpbWVzdGFtcAIAAAABXwIAAAAEZG9uZQkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAAZjYWxsZXIJAAJYAAAAAQgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5BQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tlea1SFww=", "height": 3346420, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ABaA1HdqNoRGG26SfbLu2a47DCNYBPEsKrZbV68t52a8 Next: GwPpaB56o31qAtvauwC18Y5TdWZ4zNtfXS4w8YpFZrQY Diff:
OldNewDifferences
3838 case _ =>
3939 throw("Unknown task id!")
4040 }
41-[StringEntry((chatId + "_latest"), cid), StringEntry((chatId + "_status"), "waiting"), StringEntry(taskId, chatId), StringEntry(((publicKey + "_") + chatId), ((((cid + "_") + timestamp) + "_") + "waiting")), StringEntry((chatId + "_initiator"), publicKey)]
41+[StringEntry((chatId + "_latest"), cid), StringEntry((chatId + "_status"), "waiting"), StringEntry(taskId, chatId), StringEntry(((publicKey + "_") + chatId), ((((cid + "_") + timestamp) + "_") + "waiting"))]
4242 }
4343 else throw("Strict value is not equal to itself.")
4444 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let BAI_CONTRACT_PUBLIC_KEY = base58'DS6HkopS9zypvxX6VhkdNvv6v4wcPZuChRvTwKJeacxE'
55
66 let BAI_CONTRACT = addressFromPublicKey(BAI_CONTRACT_PUBLIC_KEY)
77
88 let BAI_ASSET_ID = base58'AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1'
99
1010 @Callable(i)
1111 func getAnswerForChat (chatId,cid) = {
1212 let numberOfPayments = size(i.payments)
1313 if ((numberOfPayments != 1))
1414 then throw("Payment necessary!")
1515 else {
1616 let payment = i.payments[0]
1717 let fee = payment.amount
1818 let feeAssetId = payment.assetId
1919 let minFee = match getInteger(BAI_CONTRACT, "price_fullchatgpt") {
2020 case n: Int =>
2121 n
2222 case _ =>
2323 0
2424 }
2525 if (if ((feeAssetId != BAI_ASSET_ID))
2626 then true
2727 else (minFee > fee))
2828 then throw("Payment of the minimal BAI amount necessary!")
2929 else {
3030 let publicKey = toBase58String(i.callerPublicKey)
3131 let timestamp = toString(lastBlock.timestamp)
3232 let result = invoke(BAI_CONTRACT, "registerTaskCallback", [cid, "fullchatgpt", "callback"], [AttachedPayment(BAI_ASSET_ID, 10000000)])
3333 if ((result == result))
3434 then {
3535 let taskId = match result {
3636 case s: String =>
3737 s
3838 case _ =>
3939 throw("Unknown task id!")
4040 }
41-[StringEntry((chatId + "_latest"), cid), StringEntry((chatId + "_status"), "waiting"), StringEntry(taskId, chatId), StringEntry(((publicKey + "_") + chatId), ((((cid + "_") + timestamp) + "_") + "waiting")), StringEntry((chatId + "_initiator"), publicKey)]
41+[StringEntry((chatId + "_latest"), cid), StringEntry((chatId + "_status"), "waiting"), StringEntry(taskId, chatId), StringEntry(((publicKey + "_") + chatId), ((((cid + "_") + timestamp) + "_") + "waiting"))]
4242 }
4343 else throw("Strict value is not equal to itself.")
4444 }
4545 }
4646 }
4747
4848
4949
5050 @Callable(i)
5151 func callback (taskId,cid) = if ((i.callerPublicKey != BAI_CONTRACT_PUBLIC_KEY))
5252 then throw("Only BAI Contract is allowed to call the callback!")
5353 else {
5454 let chatId = match getString(taskId) {
5555 case s: String =>
5656 s
5757 case _ =>
5858 throw("Chat ID for task id not found!")
5959 }
6060 let publicKey = match getString((chatId + "_initiator")) {
6161 case s: String =>
6262 s
6363 case _ =>
6464 throw("No initiator found!")
6565 }
6666 let timestamp = toString(lastBlock.timestamp)
6767 [StringEntry((chatId + "_latest"), cid), StringEntry((chatId + "_status"), "done"), StringEntry(((publicKey + "_") + chatId), ((((cid + "_") + timestamp) + "_") + "done")), StringEntry("caller", toBase58String(i.callerPublicKey))]
6868 }
6969
7070
7171 @Verifier(tx)
7272 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
7373

github/deemru/w8io/fabc49c 
16.75 ms