tx · 8JJwPePouYZfBsvyDPWAqj7DpTZ2kSY9DsVXjcLBK2eq 3N91zFrRoofbPpkoDbWKrQsQSdLu2EgLL8c: -0.01000000 Waves 2023.12.06 17:20 [2874899] smart account 3N91zFrRoofbPpkoDbWKrQsQSdLu2EgLL8c > SELF 0.00000000 Waves
{ "type": 13, "id": "8JJwPePouYZfBsvyDPWAqj7DpTZ2kSY9DsVXjcLBK2eq", "fee": 1000000, "feeAssetId": null, "timestamp": 1701872397151, "version": 2, "chainId": 84, "sender": "3N91zFrRoofbPpkoDbWKrQsQSdLu2EgLL8c", "senderPublicKey": "5FyjUYCR5Q8jvG6ri6Ysz574HerUK6r1LJzzQ7DvSkLk", "proofs": [ "4dfDSgEsU4HCwu4XFSB5pTvXFdcUGkvnrLAi4jUqAQ1JeZKcxMbfXcNUJF9NJavCMQ4GEiv9oEPz1QUDFeCiebkB" ], "script": "base64:BgIVCAISBgoEAgICARIECgIICBIDCgECIQAJc2VwYXJhdG9yAgJfXwAHY2hhaW5JZAkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQAIY2hhaW5JZFQBAVQACGNoYWluSWRXAQFXAQttdXN0QWRkcmVzcwIBaQdhZGRyZXNzAwkAAAIIBQFpBmNhbGxlcgUHYWRkcmVzcwYJAAIBAhFwZXJtaXNzaW9uIGRlbmllZAEIbXVzdFRoaXMBAWkJAQttdXN0QWRkcmVzcwIFAWkFBHRoaXMAC3dhdmVzU3RyaW5nAgVXQVZFUwANcXVldWVJdGVtU2l6ZQAgAQxwYXJzZUFzc2V0SWQBBWlucHV0AwkAAAIFBWlucHV0BQt3YXZlc1N0cmluZwUEdW5pdAkA2QQBBQVpbnB1dAEPYXNzZXRJZFRvU3RyaW5nAQVpbnB1dAMJAAACBQVpbnB1dAUEdW5pdAULd2F2ZXNTdHJpbmcJANgEAQkBBXZhbHVlAQUFaW5wdXQAEWtTZXJ2aWNlUHVibGljS2V5AhQlc19fc2VydmljZVB1YmxpY0tleQANa0JvdFB1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YXJkQW1vdW50AAUEdW5pdAUDbmlsCQCUCgIJAM4IAgUHYWN0aW9ucwkAzAgCCQELQmluYXJ5RW50cnkCCQEYa0FjY291bnRDcmVhdG9yUHVibGljS2V5AQUOYWNjb3VudEFkZHJlc3MFEGNyZWF0b3JQdWJsaWNLZXkFA25pbAUEdW5pdAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgDkfR+U", "height": 2874899, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5jp7TUAuSrb2N5aiXScgKDBiKk3ahQJf3GJ8CGxVzjLU Next: QFhNiP737T9LXtvMvx5PafysZCMXSGqbvMYjNT8SBeD Diff:
Old | New | Differences | |
---|---|---|---|
140 | 140 | let U = f.callerPublicKey | |
141 | 141 | let y = f.caller | |
142 | 142 | let V = addressFromPublicKey(W) | |
143 | - | let S = [ | |
143 | + | let S = [if ((getBinary(this, x(y)) == unit)) | |
144 | 144 | then true | |
145 | 145 | else throw("account is already exists"), if ({ | |
146 | 146 | let X = scriptHash(y) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | 6 | let b = take(drop(this.bytes, 1), 1) | |
7 | 7 | ||
8 | 8 | let c = base58'2T' | |
9 | 9 | ||
10 | 10 | let d = base58'2W' | |
11 | 11 | ||
12 | 12 | func e (f,g) = if ((f.caller == g)) | |
13 | 13 | then true | |
14 | 14 | else throw("permission denied") | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func h (f) = e(f, this) | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | let i = "WAVES" | |
21 | 21 | ||
22 | 22 | let j = 32 | |
23 | 23 | ||
24 | 24 | func k (l) = if ((l == i)) | |
25 | 25 | then unit | |
26 | 26 | else fromBase58String(l) | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func m (l) = if ((l == unit)) | |
30 | 30 | then i | |
31 | 31 | else toBase58String(value(l)) | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | let n = "%s__servicePublicKey" | |
35 | 35 | ||
36 | 36 | let o = "%s__botPublicKey" | |
37 | 37 | ||
38 | 38 | let p = "%s__accountScript" | |
39 | 39 | ||
40 | 40 | func q () = valueOrErrorMessage(getBinary(this, p), "account script is not set") | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | let r = "%s__rewardAmount" | |
44 | 44 | ||
45 | 45 | func s () = valueOrErrorMessage(getInteger(this, r), "reward amount is not set") | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | let t = 0 | |
49 | 49 | ||
50 | 50 | let u = 1 | |
51 | 51 | ||
52 | 52 | func v (w) = makeString(["%s%s", toBase58String(w), "status"], a) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func x (y) = makeString(["%s%s", toString(y), "creatorPublicKey"], a) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func z (w) = makeString(["%s%s", toBase58String(w), "ownerPublicKey"], a) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func A (w) = makeString(["%s%s", toBase58String(w), "amountAssetId"], a) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func B (w) = makeString(["%s%s", toBase58String(w), "priceAssetId"], a) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func C (w) = makeString(["%s%s", toBase58String(w), "requestIdToAccountPublicKey"], a) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func D (y) = makeString(["%s%s", toString(y), "accountAddressToRequestId"], a) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func E () = makeString(["%s", "requestsQueue"], a) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func F () = valueOrElse(getBinary(this, E()), base58'') | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func G () = makeString(["%s", "accountsQueue"], a) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func H () = valueOrElse(getBinary(this, G()), base58'') | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func I (J,K) = makeString(["%s%s%s", m(J), m(K), "pairAllowed"], a) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func L (J,K) = valueOrElse(getBoolean(this, I(J, K)), false) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | let M = addressFromPublicKey(getBinaryValue(this, n)) | |
92 | 92 | ||
93 | 93 | let N = getBinaryValue(this, o) | |
94 | 94 | ||
95 | 95 | @Callable(f) | |
96 | 96 | func init (O,N,q,s) = { | |
97 | 97 | let P = h(f) | |
98 | 98 | if ((P == P)) | |
99 | 99 | then $Tuple2([BinaryEntry(n, O), BinaryEntry(o, N), BinaryEntry(p, q), IntegerEntry(r, s)], unit) | |
100 | 100 | else throw("Strict value is not equal to itself.") | |
101 | 101 | } | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | ||
105 | 105 | @Callable(f) | |
106 | 106 | func requestAccount (Q,R) = { | |
107 | 107 | let w = sha256(((f.caller.bytes + fromBase58String(Q)) + fromBase58String(R))) | |
108 | 108 | let J = k(Q) | |
109 | 109 | let K = k(R) | |
110 | 110 | let S = [if ((size(f.payments) == 1)) | |
111 | 111 | then true | |
112 | 112 | else throw("1 payment is required"), if ((f.payments[0].assetId == unit)) | |
113 | 113 | then true | |
114 | 114 | else throw("invalid asset"), if ((f.payments[0].amount == s())) | |
115 | 115 | then true | |
116 | 116 | else throw("invalid amount"), if (L(J, K)) | |
117 | 117 | then true | |
118 | 118 | else throw("pair is not allowed"), if ((getInteger(this, v(w)) == unit)) | |
119 | 119 | then true | |
120 | 120 | else throw("account is already exists")] | |
121 | 121 | if ((S == S)) | |
122 | 122 | then { | |
123 | 123 | let T = if ((size(H()) == 0)) | |
124 | 124 | then [IntegerEntry(v(w), t), BinaryEntry(E(), (F() + w))] | |
125 | 125 | else { | |
126 | 126 | let U = take(H(), j) | |
127 | 127 | let y = addressFromPublicKey(U) | |
128 | 128 | let V = addressFromPublicKey(valueOrErrorMessage(getBinary(this, x(y)), "invalid creator public key")) | |
129 | 129 | [BinaryEntry(G(), drop(H(), j)), IntegerEntry(v(w), u), BinaryEntry(C(w), U), StringEntry(D(y), toBase58String(w)), ScriptTransfer(V, s(), unit)] | |
130 | 130 | } | |
131 | 131 | $Tuple2((T ++ [BinaryEntry(z(w), f.callerPublicKey), StringEntry(A(w), Q), StringEntry(B(w), R)]), unit) | |
132 | 132 | } | |
133 | 133 | else throw("Strict value is not equal to itself.") | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | ||
138 | 138 | @Callable(f) | |
139 | 139 | func addAccount (W) = { | |
140 | 140 | let U = f.callerPublicKey | |
141 | 141 | let y = f.caller | |
142 | 142 | let V = addressFromPublicKey(W) | |
143 | - | let S = [ | |
143 | + | let S = [if ((getBinary(this, x(y)) == unit)) | |
144 | 144 | then true | |
145 | 145 | else throw("account is already exists"), if ({ | |
146 | 146 | let X = scriptHash(y) | |
147 | 147 | if ($isInstanceOf(X, "ByteVector")) | |
148 | 148 | then { | |
149 | 149 | let Y = X | |
150 | 150 | (Y == blake2b256_32Kb(q())) | |
151 | 151 | } | |
152 | 152 | else false | |
153 | 153 | }) | |
154 | 154 | then true | |
155 | 155 | else throw("invalid script")] | |
156 | 156 | if ((S == S)) | |
157 | 157 | then { | |
158 | 158 | let T = if ((size(F()) == 0)) | |
159 | 159 | then [BinaryEntry(G(), (H() + U))] | |
160 | 160 | else { | |
161 | 161 | let w = take(F(), j) | |
162 | 162 | [BinaryEntry(E(), drop(F(), j)), IntegerEntry(v(w), u), BinaryEntry(C(w), U), StringEntry(D(y), toBase58String(w)), ScriptTransfer(V, s(), unit)] | |
163 | 163 | } | |
164 | 164 | $Tuple2((T ++ [BinaryEntry(x(y), W)]), unit) | |
165 | 165 | } | |
166 | 166 | else throw("Strict value is not equal to itself.") | |
167 | 167 | } | |
168 | 168 | ||
169 | 169 |
github/deemru/w8io/026f985 31.47 ms ◑