tx · GwPpaB56o31qAtvauwC18Y5TdWZ4zNtfXS4w8YpFZrQY 3MxW2aG6PcdZeNjj1DuzGSbmWoy2BDvmtSD: -0.05000000 Waves 2024.10.28 10:26 [3346421] smart account 3MxW2aG6PcdZeNjj1DuzGSbmWoy2BDvmtSD > SELF 0.00000000 Waves
{ "type": 13, "id": "GwPpaB56o31qAtvauwC18Y5TdWZ4zNtfXS4w8YpFZrQY", "fee": 5000000, "feeAssetId": null, "timestamp": 1730100376584, "version": 2, "chainId": 84, "sender": "3MxW2aG6PcdZeNjj1DuzGSbmWoy2BDvmtSD", "senderPublicKey": "HtED8Ks6yPKYzEnXYAoLvskVyZuFW3YcZH8JF5NWbMvb", "proofs": [ "4pGiGo5He7G56DWt3Zc8iP9csgqUaBTxb6yQmZPzPzfy31irxk3aqi7TJqVWeRwqCYAasQkp2pbEqfX5tsEgp57t" ], "script": "base64:AAIFAAAAAAAAAA4IAhIECgIICBIECgIICAAAAAMAAAAAF0JBSV9DT05UUkFDVF9QVUJMSUNfS0VZAQAAACC4ub5WQ6dKmSY4XOD0ENHA5nSTpo3ZXmT/mOT2RZ2+BwAAAAAMQkFJX0NPTlRSQUNUCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABBQAAABdCQUlfQ09OVFJBQ1RfUFVCTElDX0tFWQAAAAAMQkFJX0FTU0VUX0lEAQAAACCT4XI4cQSbauiaYx8EJLdkU5csPrxmC4N0r2i7JI3iQgAAAAIAAAABaQEAAAAQZ2V0QW5zd2VyRm9yQ2hhdAAAAAIAAAAGY2hhdElkAAAAA2NpZAQAAAAQbnVtYmVyT2ZQYXltZW50cwkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwMJAQAAAAIhPQAAAAIFAAAAEG51bWJlck9mUGF5bWVudHMAAAAAAAAAAAEJAAACAAAAAQIAAAASUGF5bWVudCBuZWNlc3NhcnkhBAAAAAdwYXltZW50CQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAA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Y2hhdElkAgAAAApfaW5pdGlhdG9yAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAXMFAAAAByRtYXRjaDAFAAAAAXMJAAACAAAAAQIAAAATTm8gaW5pdGlhdG9yIGZvdW5kIQQAAAAJdGltZXN0YW1wCQABpAAAAAEIBQAAAAlsYXN0QmxvY2sAAAAJdGltZXN0YW1wCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgUAAAAGY2hhdElkAgAAAAdfbGF0ZXN0BQAAAANjaWQJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACBQAAAAZjaGF0SWQCAAAAB19zdGF0dXMCAAAABGRvbmUJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAACXB1YmxpY0tleQIAAAABXwUAAAAGY2hhdElkCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIFAAAAA2NpZAIAAAABXwUAAAAJdGltZXN0YW1wAgAAAAFfAgAAAARkb25lBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleYP6bkA=", "height": 3346421, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5qQ85zpAxSyB9afHreKfKtpygPHHzkuYvHCzDnQjMMA4 Next: 12vSW3GQ95NrhnTVMPNneumJVD8ko3qnoDzfKf2AjyQT Diff:
Old | New | Differences | |
---|---|---|---|
44 | 44 | } | |
45 | 45 | else throw("Unknown task id!") | |
46 | 46 | } | |
47 | - | [StringEntry((e + "_latest"), f), StringEntry((e + "_status"), "waiting"), StringEntry(q, e), StringEntry(((n + "_") + e), ((((f + "_") + o) + "_") + "waiting"))] | |
47 | + | [StringEntry((e + "_latest"), f), StringEntry((e + "_status"), "waiting"), StringEntry(q, e), StringEntry(((n + "_") + e), ((((f + "_") + o) + "_") + "waiting")), StringEntry((e + "_initiator"), n)] | |
48 | 48 | } | |
49 | 49 | else throw("Strict value is not equal to itself.") | |
50 | 50 | } | |
76 | 76 | else throw("No initiator found!") | |
77 | 77 | } | |
78 | 78 | let o = toString(lastBlock.timestamp) | |
79 | - | [StringEntry((e + "_latest"), f), StringEntry((e + "_status"), "done"), StringEntry(((n + "_") + e), ((((f + "_") + o) + "_") + "done")) | |
79 | + | [StringEntry((e + "_latest"), f), StringEntry((e + "_status"), "done"), StringEntry(((n + "_") + e), ((((f + "_") + o) + "_") + "done"))] | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'DS6HkopS9zypvxX6VhkdNvv6v4wcPZuChRvTwKJeacxE' | |
5 | 5 | ||
6 | 6 | let b = addressFromPublicKey(a) | |
7 | 7 | ||
8 | 8 | let c = base58'AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1' | |
9 | 9 | ||
10 | 10 | @Callable(d) | |
11 | 11 | func getAnswerForChat (e,f) = { | |
12 | 12 | let g = size(d.payments) | |
13 | 13 | if ((g != 1)) | |
14 | 14 | then throw("Payment necessary!") | |
15 | 15 | else { | |
16 | 16 | let h = d.payments[0] | |
17 | 17 | let i = h.amount | |
18 | 18 | let j = h.assetId | |
19 | 19 | let k = { | |
20 | 20 | let l = getInteger(b, "price_fullchatgpt") | |
21 | 21 | if ($isInstanceOf(l, "Int")) | |
22 | 22 | then { | |
23 | 23 | let m = l | |
24 | 24 | m | |
25 | 25 | } | |
26 | 26 | else 0 | |
27 | 27 | } | |
28 | 28 | if (if ((j != c)) | |
29 | 29 | then true | |
30 | 30 | else (k > i)) | |
31 | 31 | then throw("Payment of the minimal BAI amount necessary!") | |
32 | 32 | else { | |
33 | 33 | let n = toBase58String(d.callerPublicKey) | |
34 | 34 | let o = toString(lastBlock.timestamp) | |
35 | 35 | let p = invoke(b, "registerTaskCallback", [f, "fullchatgpt", "callback"], [AttachedPayment(c, 10000000)]) | |
36 | 36 | if ((p == p)) | |
37 | 37 | then { | |
38 | 38 | let q = { | |
39 | 39 | let l = p | |
40 | 40 | if ($isInstanceOf(l, "String")) | |
41 | 41 | then { | |
42 | 42 | let r = l | |
43 | 43 | r | |
44 | 44 | } | |
45 | 45 | else throw("Unknown task id!") | |
46 | 46 | } | |
47 | - | [StringEntry((e + "_latest"), f), StringEntry((e + "_status"), "waiting"), StringEntry(q, e), StringEntry(((n + "_") + e), ((((f + "_") + o) + "_") + "waiting"))] | |
47 | + | [StringEntry((e + "_latest"), f), StringEntry((e + "_status"), "waiting"), StringEntry(q, e), StringEntry(((n + "_") + e), ((((f + "_") + o) + "_") + "waiting")), StringEntry((e + "_initiator"), n)] | |
48 | 48 | } | |
49 | 49 | else throw("Strict value is not equal to itself.") | |
50 | 50 | } | |
51 | 51 | } | |
52 | 52 | } | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | ||
56 | 56 | @Callable(d) | |
57 | 57 | func callback (q,f) = if ((d.callerPublicKey != a)) | |
58 | 58 | then throw("Only BAI Contract is allowed to call the callback!") | |
59 | 59 | else { | |
60 | 60 | let e = { | |
61 | 61 | let l = getString(q) | |
62 | 62 | if ($isInstanceOf(l, "String")) | |
63 | 63 | then { | |
64 | 64 | let r = l | |
65 | 65 | r | |
66 | 66 | } | |
67 | 67 | else throw("Chat ID for task id not found!") | |
68 | 68 | } | |
69 | 69 | let n = { | |
70 | 70 | let l = getString((e + "_initiator")) | |
71 | 71 | if ($isInstanceOf(l, "String")) | |
72 | 72 | then { | |
73 | 73 | let r = l | |
74 | 74 | r | |
75 | 75 | } | |
76 | 76 | else throw("No initiator found!") | |
77 | 77 | } | |
78 | 78 | let o = toString(lastBlock.timestamp) | |
79 | - | [StringEntry((e + "_latest"), f), StringEntry((e + "_status"), "done"), StringEntry(((n + "_") + e), ((((f + "_") + o) + "_") + "done")) | |
79 | + | [StringEntry((e + "_latest"), f), StringEntry((e + "_status"), "done"), StringEntry(((n + "_") + e), ((((f + "_") + o) + "_") + "done"))] | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | @Verifier(s) | |
84 | 84 | func t () = sigVerify(s.bodyBytes, s.proofs[0], s.senderPublicKey) | |
85 | 85 |
github/deemru/w8io/fabc49c 17.87 ms ◑