tx · DMC6hoZKRKR58wnA6EnRcDCpfAh8reFTn8WTiY5TfXeA 3N9XUY4TCK9rbrnuuHhniWgzZvTWEDQbz3m: -0.01000000 Waves 2021.07.24 16:01 [1627751] smart account 3N9XUY4TCK9rbrnuuHhniWgzZvTWEDQbz3m > SELF 0.00000000 Waves
{ "type": 13, "id": "DMC6hoZKRKR58wnA6EnRcDCpfAh8reFTn8WTiY5TfXeA", "fee": 1000000, "feeAssetId": null, "timestamp": 1627131698158, "version": 2, "chainId": 84, "sender": "3N9XUY4TCK9rbrnuuHhniWgzZvTWEDQbz3m", "senderPublicKey": "5T2aguuLUCnpqZJCfGMszGbxDZmzchjmTERevjCdiMyr", "proofs": [ "5CQu7PXo8HustapkWCPfU56mi8RYbWzxPRzShytDiWSyVPbjwD9UFa8W9oW8La1t1g4qQmiHmfYtxWHvX6NEvrMb" ], "script": "base64:AAIFAAAAAAAAApsIAhIDCgEIEgMKAQgaHAoCYTESFmZhY3RvcnlDb250cmFjdEFkZHJlc3MaIwoCYTISHXByb2ZpbGVzT3JhY2xlQ29udHJhY3RBZGRyZXNzGhYKAmEzEhBnaXZlU3RhdGVQZW5kaW5nGhQKAmE0Eg5naXZlU3RhdGVUYWtlZBoTCgJhNRINZGF0YVNlcGFyYXRvchoXCgJhNhIRZ2V0TGFzdEdpdmVJZHhLZXkaCgoCYTcSBGFkZHIaFAoCYTgSDmdldExhc3RHaXZlSWR4Gg0KAmE5EgckbWF0Y2gwGgcKAmIxEgFpGhMKAmIyEg1nZXROZXdHaXZlSWR4Gg8KAmIzEglnZXRHaXZlSWQaCQoCYjQSA2lkeBoVCgJiNRIPZ2V0R2l2ZVN0YXRlS2V5GgwKAmI2EgZnaXZlSWQaFAoCYjcSDmdldEdpdmVEYXRhS2V5GhsKAmI4EhVnZW5lcmF0ZUdpdmVEYXRhVmFsdWUaDwoCYjkSCWhhc2hlZFVyaRoRCgJjMRILYml0b2dyYXBoSWQaGAoCYzISEnBhcnNlR2l2ZURhdGFWYWx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kNAkBAAAAAmI4AAAAAgUAAAACYjkFAAAAAmMxBQAAAANuaWwAAAACYjEBAAAACHRha2VHaXZlAAAAAQAAAAJiNgQAAAACZDUJAQAAAAJjNAAAAAEFAAAAAmI2BAAAAAJkNgQAAAACYTkJAAQdAAAAAgkBAAAAB0FkZHJlc3MAAAABBQAAAAJhMgkAAZEAAAACBQAAAAJkNQAAAAAAAAAAAAMJAAABAAAAAgUAAAACYTkCAAAABlN0cmluZwQAAAACYTcFAAAAAmE5CQEAAAAHQWRkcmVzcwAAAAEJAAJZAAAAAQUAAAACYTcJAAACAAAAAQIAAAAuUmVjaXBpZW50IG9mIHNwZWNpZmllZCBnaXZlIGRvZXMgbm90IGV4aXN0IHlldAMJAQAAAAIhPQAAAAIFAAAAAmQ2CAUAAAACYjEAAAAGY2FsbGVyCQAAAgAAAAECAAAAHFlvdSBjYW5ub3QgdGFrZSBmb3JlaWduIGdpdmUEAAAAAmMxCQACWQAAAAEJAAGRAAAAAgUAAAACZDUAAAAAAAAAAAEJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkBAAAAAmI1AAAAAQUAAAACYjYFAAAAAmE0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAAmQ2AAAAAAAAAAABBQAAAAJjMQUAAAADbmlsAAAAAQAAAAJkNwEAAAACZDgAAAAACQAB9AAAAAMIBQAAAAJkNwAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAmQ3AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAmQ3AAAAD3NlbmRlclB1YmxpY0tleVsoFkg=", "height": 1627751, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = base58'3N4v4VAHbK5das4wB5QGripYbQFJ3PaB75e' | |
5 | + | ||
6 | + | let b = base58'3MsKhh2tBJqUdyNakXBjdq3vL7uR5Yrz6Dc' | |
7 | + | ||
8 | + | let c = "PENDING" | |
9 | + | ||
10 | + | let d = "TAKED" | |
11 | + | ||
12 | + | let e = "__" | |
13 | + | ||
14 | + | func f (g) = (toString(g) + ":last_give_idx") | |
15 | + | ||
16 | + | ||
17 | + | func h (g) = { | |
18 | + | let i = getInteger(this, f(g)) | |
19 | + | if ($isInstanceOf(i, "Int")) | |
20 | + | then { | |
21 | + | let j = i | |
22 | + | j | |
23 | + | } | |
24 | + | else 1 | |
25 | + | } | |
26 | + | ||
27 | + | ||
28 | + | func k (g) = (h(g) + 1) | |
29 | + | ||
30 | + | ||
31 | + | func l (g,m) = ((toString(g) + ":") + toString(m)) | |
32 | + | ||
33 | + | ||
34 | + | func n (o) = (("give:" + o) + ":state") | |
35 | + | ||
36 | + | ||
37 | + | func p (o) = (("give:" + o) + ":data") | |
38 | + | ||
39 | + | ||
40 | + | func q (r,s) = ((r + e) + toBase58String(s)) | |
41 | + | ||
42 | + | ||
43 | + | func t (u) = split(u, e) | |
44 | + | ||
45 | + | ||
46 | + | func v (o) = { | |
47 | + | let w = { | |
48 | + | let i = getString(this, n(o)) | |
49 | + | if ($isInstanceOf(i, "String")) | |
50 | + | then { | |
51 | + | let x = i | |
52 | + | x | |
53 | + | } | |
54 | + | else throw("Give with specified id does not exist") | |
55 | + | } | |
56 | + | if ((w != c)) | |
57 | + | then throw("Give is not in pending state") | |
58 | + | else { | |
59 | + | let y = getStringValue(this, p(o)) | |
60 | + | t(y) | |
61 | + | } | |
62 | + | } | |
63 | + | ||
64 | + | ||
65 | + | func z (A) = if (if ((A.decimals == 0)) | |
66 | + | then true | |
67 | + | else (A.quantity == 1)) | |
68 | + | then true | |
69 | + | else !(A.reissuable) | |
70 | + | ||
71 | + | ||
72 | + | @Callable(j) | |
73 | + | func createGive (r) = if ((1 > size(j.payments))) | |
74 | + | then throw("Bitograph have to be send as payment for tx") | |
75 | + | else { | |
76 | + | let s = { | |
77 | + | let i = j.payments[0].assetId | |
78 | + | if ($isInstanceOf(i, "Unit")) | |
79 | + | then throw("Specified payment is not a valid bitograph") | |
80 | + | else if ($isInstanceOf(i, "ByteVector")) | |
81 | + | then { | |
82 | + | let B = i | |
83 | + | B | |
84 | + | } | |
85 | + | else throw("Match error") | |
86 | + | } | |
87 | + | if ((1 > j.payments[0].amount)) | |
88 | + | then throw("You have to send at least one bitograph for give creating") | |
89 | + | else { | |
90 | + | let C = { | |
91 | + | let i = assetInfo(s) | |
92 | + | if ($isInstanceOf(i, "Unit")) | |
93 | + | then throw("Specified payment is not a valid bitograph") | |
94 | + | else if ($isInstanceOf(i, "Asset")) | |
95 | + | then { | |
96 | + | let A = i | |
97 | + | A | |
98 | + | } | |
99 | + | else throw("Match error") | |
100 | + | } | |
101 | + | if (if ((C.issuer != Address(a))) | |
102 | + | then true | |
103 | + | else !(z(C))) | |
104 | + | then throw("Specified asset is not a valid bitograph") | |
105 | + | else { | |
106 | + | let D = k(j.caller) | |
107 | + | let E = l(j.caller, D) | |
108 | + | [IntegerEntry(f(j.caller), D), StringEntry(n(E), c), StringEntry(p(E), q(r, s))] | |
109 | + | } | |
110 | + | } | |
111 | + | } | |
112 | + | ||
113 | + | ||
114 | + | ||
115 | + | @Callable(j) | |
116 | + | func takeGive (o) = { | |
117 | + | let F = v(o) | |
118 | + | let G = { | |
119 | + | let i = getString(Address(b), F[0]) | |
120 | + | if ($isInstanceOf(i, "String")) | |
121 | + | then { | |
122 | + | let g = i | |
123 | + | Address(fromBase58String(g)) | |
124 | + | } | |
125 | + | else throw("Recipient of specified give does not exist yet") | |
126 | + | } | |
127 | + | if ((G != j.caller)) | |
128 | + | then throw("You cannot take foreign give") | |
129 | + | else { | |
130 | + | let s = fromBase58String(F[1]) | |
131 | + | [StringEntry(n(o), d), ScriptTransfer(G, 1, s)] | |
132 | + | } | |
133 | + | } | |
134 | + | ||
135 | + | ||
136 | + | @Verifier(H) | |
137 | + | func I () = sigVerify(H.bodyBytes, H.proofs[0], H.senderPublicKey) | |
138 | + |
github/deemru/w8io/026f985 18.31 ms ◑