tx · EamjdpPJBpjpX3gRm3DL1m1LwzCRzwBE1GxHkMtnE7zQ 3MxW2aG6PcdZeNjj1DuzGSbmWoy2BDvmtSD: -0.01000000 Waves 2024.10.26 16:49 [3343889] smart account 3MxW2aG6PcdZeNjj1DuzGSbmWoy2BDvmtSD > SELF 0.00000000 Waves
{ "type": 13, "id": "EamjdpPJBpjpX3gRm3DL1m1LwzCRzwBE1GxHkMtnE7zQ", "fee": 1000000, "feeAssetId": null, "timestamp": 1729950560077, "version": 2, "chainId": 84, "sender": "3MxW2aG6PcdZeNjj1DuzGSbmWoy2BDvmtSD", "senderPublicKey": "HtED8Ks6yPKYzEnXYAoLvskVyZuFW3YcZH8JF5NWbMvb", "proofs": [ "4A5JVhfERvFyHvR4vNds8qQvGJWSio4KtqkWkeQ23MNnH43oqreAqNyh4HLkNuoyJUFxfiRp6X2WKP1eu4um224E" ], "script": "base64:AAIFAAAAAAAAAA4IAhIECgIICBIECgIICAAAAAIAAAAADEJBSV9DT05UUkFDVAIAAAAjM045dEtpeHpxVFlXbkVYUXhyRFE1cEJUR3ZRZDZzRnN2bVYAAAAADEJBSV9BU1NFVF9JRAEAAAAgk+FyOHEEm2rommMfBCS3ZFOXLD68ZguDdK9ouySN4kIAAAACAAAAAWkBAAAAEGdldEFuc3dlckZvckNoYXQAAAACAAAABmNoYXRJZAAAAANjaWQEAAAAEG51bWJlck9mUGF5bWVudHMJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMDCQEAAAACIT0AAAACBQAAABBudW1iZXJPZlBheW1lbnRzAAAAAAAAAAABCQAAAgAAAAECAAAAElBheW1lbnQgbmVjZXNzYXJ5IQQAAAAHcGF5bWVudAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAADZmVlCAUAAAAHcGF5bWVudAAAAAZhbW91bnQEAAAACmZlZUFzc2V0SWQIBQAAAAdwYXltZW50AAAAB2Fzc2V0SWQEAAAABm1pbkZlZQQAAAAHJG1hdGNo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AGdGFza0lkBQAAAAZjaGF0SWQFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABaQEAAAAIY2FsbGJhY2sAAAACAAAABnRhc2tJZAAAAANjaWQEAAAABmNoYXRJZAQAAAAHJG1hdGNoMAkABCIAAAABBQAAAAZ0YXNrSWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABcwUAAAAHJG1hdGNoMAUAAAABcwkAAAIAAAABAgAAAB5DaGF0IElEIGZvciB0YXNrIGlkIG5vdCBmb3VuZCEJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACBQAAAAZjaGF0SWQCAAAAB19sYXRlc3QFAAAAA2NpZAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIFAAAABmNoYXRJZAIAAAAHX3N0YXR1cwIAAAAEZG9uZQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXnbCtMF", "height": 3343889, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 52J27mwPQxE6zAUGtd8E4ipsnPnrFgCXyj28vbyNo7vL Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let BAI_CONTRACT = "3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV" | |
5 | + | ||
6 | + | let BAI_ASSET_ID = base58'AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1' | |
7 | + | ||
8 | + | @Callable(i) | |
9 | + | func getAnswerForChat (chatId,cid) = { | |
10 | + | let numberOfPayments = size(i.payments) | |
11 | + | if ((numberOfPayments != 1)) | |
12 | + | then throw("Payment necessary!") | |
13 | + | else { | |
14 | + | let payment = i.payments[0] | |
15 | + | let fee = payment.amount | |
16 | + | let feeAssetId = payment.assetId | |
17 | + | let minFee = match getInteger(Address(fromBase58String(BAI_CONTRACT)), "price_tictactoe") { | |
18 | + | case n: Int => | |
19 | + | n | |
20 | + | case _ => | |
21 | + | 0 | |
22 | + | } | |
23 | + | if (if ((feeAssetId != BAI_ASSET_ID)) | |
24 | + | then true | |
25 | + | else (minFee > fee)) | |
26 | + | then throw("Payment of the minimal BAI amount necessary!") | |
27 | + | else { | |
28 | + | let result = invoke(Address(fromBase58String(BAI_CONTRACT)), "registerTaskCallback", [cid, "fullchatgpt", "callback"], [AttachedPayment(BAI_ASSET_ID, 10000000)]) | |
29 | + | if ((result == result)) | |
30 | + | then { | |
31 | + | let taskId = match result { | |
32 | + | case s: String => | |
33 | + | s | |
34 | + | case _ => | |
35 | + | throw("Unknown task id!") | |
36 | + | } | |
37 | + | [StringEntry((chatId + "_latest"), cid), StringEntry((chatId + "_status"), "waiting"), StringEntry(taskId, chatId)] | |
38 | + | } | |
39 | + | else throw("Strict value is not equal to itself.") | |
40 | + | } | |
41 | + | } | |
42 | + | } | |
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | @Callable(i) | |
47 | + | func callback (taskId,cid) = { | |
48 | + | let chatId = match getString(taskId) { | |
49 | + | case s: String => | |
50 | + | s | |
51 | + | case _ => | |
52 | + | throw("Chat ID for task id not found!") | |
53 | + | } | |
54 | + | [StringEntry((chatId + "_latest"), cid), StringEntry((chatId + "_status"), "done")] | |
55 | + | } | |
56 | + | ||
57 | + | ||
58 | + | @Verifier(tx) | |
59 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
60 | + |
github/deemru/w8io/fabc49c 10.42 ms ◑