tx · 7t3hKbDaEDscitJVr4p2E8VYHPpHPdBu2XdTzHaHbpfw
3N91zFrRoofbPpkoDbWKrQsQSdLu2EgLL8c: -0.01000000 Waves
2023.10.23 15:48 [2811272] smart account 3N91zFrRoofbPpkoDbWKrQsQSdLu2EgLL8c > SELF 0.00000000 Waves
{
"type": 13,
"id": "7t3hKbDaEDscitJVr4p2E8VYHPpHPdBu2XdTzHaHbpfw",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1698065312393,
"version": 2,
"chainId": 84,
"sender": "3N91zFrRoofbPpkoDbWKrQsQSdLu2EgLL8c",
"senderPublicKey": "5FyjUYCR5Q8jvG6ri6Ysz574HerUK6r1LJzzQ7DvSkLk",
"proofs": [
"3PoE7kRYzWX16BYuFvokKMWEbC2rTeXpVmYhf4xdz8F7p9NRMv4VoC7CJEddpntMo43DEMjY7VcqDXZfc4dpAsNm"
],
"script": "base64:BgIWCAISBgoEAgICARIECgIICBIECgIIAh0ACXNlcGFyYXRvcgICX18AB2NoYWluSWQJAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEACGNoYWluSWRUAQFUAAhjaGFpbklkVwEBVwELbXVzdEFkZHJlc3MCAWkHYWRkcmVzcwMJAAACCAUBaQZjYWxsZXIFB2FkZHJlc3MGCQACAQIRcGVybWlzc2lvbiBkZW5pZWQBCG11c3RUaGlzAQFpCQELbXVzdEFkZHJlc3MCBQFpBQR0aGlzAAt3YXZlc1N0cmluZwIFV0FWRVMBDHBhcnNlQXNzZXRJZAEFaW5wdXQDCQAAAgUFaW5wdXQFC3dhdmVzU3RyaW5nBQR1bml0CQDZBAEFBWlucHV0AQ9hc3NldElkVG9TdHJpbmcBBWlucHV0AwkAAAIFBWlucHV0BQR1bml0BQt3YXZlc1N0cmluZwkA2AQBCQEFdmFsdWUBBQVpbnB1dAARa1NlcnZpY2VQdWJsaWNLZXkCFCVzX19zZXJ2aWNlUHVibGljS2V5AA1rQm90UHVibGljS2V5AhAlc19fYm90UHVibGljS2V5AA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52YWxpZCBzY3JpcHQFA25pbAMJAAACBQZjaGVja3MFBmNoZWNrcwQOY3JlYXRvckFkZHJlc3MJAKcIAQUQY3JlYXRvclB1YmxpY0tleQkAlAoCCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQEOa0FjY291bnRTdGF0dXMBBQlhY2NvdW50SWQFFEFDQ09VTlRfU1RBVFVTX1JFQURZCQDMCAIJAQtCaW5hcnlFbnRyeQIJARhrQWNjb3VudENyZWF0b3JQdWJsaWNLZXkBBQlhY2NvdW50SWQFEGNyZWF0b3JQdWJsaWNLZXkJAMwIAgkBC0JpbmFyeUVudHJ5AgkBHGtBY2NvdW50SWRUb0FjY291bnRQdWJsaWNLZXkBBQlhY2NvdW50SWQFEGFjY291bnRQdWJsaWNLZXkJAMwIAgkBC1N0cmluZ0VudHJ5AgkBGmtBY2NvdW50QWRkcmVzc1RvQWNjb3VudElkAQUOYWNjb3VudEFkZHJlc3MFCWFjY291bnRJZAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDBQ5jcmVhdG9yQWRkcmVzcwkBDHJld2FyZEFtb3VudAAFBHVuaXQFA25pbAUEdW5pdAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgB31fZ8",
"height": 2811272,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: ekrk3RoaYGx5v5Sm47tvYU1fNAuUmsg9N85pwhynBd3
Next: FfCyS8xwSAAYPb9DTjHEHZhzGvJ2EfbVxbom5qMCQUts
Diff:
Old | New | | Differences |
---|
17 | 17 | | func h (f) = e(f, this) |
---|
18 | 18 | | |
---|
19 | 19 | | |
---|
20 | | - | let i = "%s__servicePublicKey" |
---|
| 20 | + | let i = "WAVES" |
---|
21 | 21 | | |
---|
22 | | - | let j = "%s__botPublicKey" |
---|
23 | | - | |
---|
24 | | - | let k = "%s__accountScript" |
---|
25 | | - | |
---|
26 | | - | func l () = valueOrErrorMessage(getBinary(this, k), "account script is not set") |
---|
| 22 | + | func j (k) = if ((k == i)) |
---|
| 23 | + | then unit |
---|
| 24 | + | else fromBase58String(k) |
---|
27 | 25 | | |
---|
28 | 26 | | |
---|
29 | | - | let m = "%s__rewardAmount" |
---|
30 | | - | |
---|
31 | | - | func n () = valueOrErrorMessage(getInteger(this, m), "reward amount is not set") |
---|
| 27 | + | func l (k) = if ((k == unit)) |
---|
| 28 | + | then i |
---|
| 29 | + | else toBase58String(value(k)) |
---|
32 | 30 | | |
---|
33 | 31 | | |
---|
34 | | - | let o = 0 |
---|
| 32 | + | let m = "%s__servicePublicKey" |
---|
35 | 33 | | |
---|
36 | | - | let p = 1 |
---|
| 34 | + | let n = "%s__botPublicKey" |
---|
37 | 35 | | |
---|
38 | | - | func q (r) = makeString(["%s%s", r, "status"], a) |
---|
| 36 | + | let o = "%s__accountScript" |
---|
| 37 | + | |
---|
| 38 | + | func p () = valueOrErrorMessage(getBinary(this, o), "account script is not set") |
---|
39 | 39 | | |
---|
40 | 40 | | |
---|
41 | | - | func s (r) = valueOrErrorMessage(getInteger(this, q(r)), "account is not found") |
---|
| 41 | + | let q = "%s__rewardAmount" |
---|
| 42 | + | |
---|
| 43 | + | func r () = valueOrErrorMessage(getInteger(this, q), "reward amount is not set") |
---|
42 | 44 | | |
---|
43 | 45 | | |
---|
44 | | - | func t (r) = makeString(["%s%s", r, "creatorPublicKey"], a) |
---|
| 46 | + | let s = 0 |
---|
| 47 | + | |
---|
| 48 | + | let t = 1 |
---|
| 49 | + | |
---|
| 50 | + | func u (v) = makeString(["%s%s", v, "status"], a) |
---|
45 | 51 | | |
---|
46 | 52 | | |
---|
47 | | - | func u (r) = makeString(["%s%s", r, "ownerPublicKey"], a) |
---|
| 53 | + | func w (v) = valueOrErrorMessage(getInteger(this, u(v)), "account is not found") |
---|
48 | 54 | | |
---|
49 | 55 | | |
---|
50 | | - | func v (r) = makeString(["%s%s", r, "amountAssetId"], a) |
---|
| 56 | + | func x (v) = makeString(["%s%s", v, "creatorPublicKey"], a) |
---|
51 | 57 | | |
---|
52 | 58 | | |
---|
53 | | - | func w (r) = makeString(["%s%s", r, "priceAssetId"], a) |
---|
| 59 | + | func y (v) = makeString(["%s%s", v, "ownerPublicKey"], a) |
---|
54 | 60 | | |
---|
55 | 61 | | |
---|
56 | | - | func x (r) = makeString(["%s%s", r, "accountIdToAccountPublicKey"], a) |
---|
| 62 | + | func z (v) = makeString(["%s%s", v, "amountAssetId"], a) |
---|
57 | 63 | | |
---|
58 | 64 | | |
---|
59 | | - | func y (z) = makeString(["%s%s", toString(z), "accountAddressToAccountId"], a) |
---|
| 65 | + | func A (v) = makeString(["%s%s", v, "priceAssetId"], a) |
---|
60 | 66 | | |
---|
61 | 67 | | |
---|
62 | | - | func A (B,C) = makeString(["%s%s%s", toBase58String(B), toBase58String(C), "pairAllowed"], a) |
---|
| 68 | + | func B (v) = makeString(["%s%s", v, "accountIdToAccountPublicKey"], a) |
---|
63 | 69 | | |
---|
64 | 70 | | |
---|
65 | | - | func D (B,C) = valueOrElse(getBoolean(this, A(B, C)), false) |
---|
| 71 | + | func C (D) = makeString(["%s%s", toString(D), "accountAddressToAccountId"], a) |
---|
66 | 72 | | |
---|
67 | 73 | | |
---|
68 | | - | let E = addressFromPublicKey(getBinaryValue(this, i)) |
---|
| 74 | + | func E (F,G) = makeString(["%s%s%s", l(F), l(G), "pairAllowed"], a) |
---|
69 | 75 | | |
---|
70 | | - | let F = getBinaryValue(this, j) |
---|
| 76 | + | |
---|
| 77 | + | func H (F,G) = valueOrElse(getBoolean(this, E(F, G)), false) |
---|
| 78 | + | |
---|
| 79 | + | |
---|
| 80 | + | let I = addressFromPublicKey(getBinaryValue(this, m)) |
---|
| 81 | + | |
---|
| 82 | + | let J = getBinaryValue(this, n) |
---|
71 | 83 | | |
---|
72 | 84 | | @Callable(f) |
---|
73 | | - | func init (G,F,l,n) = { |
---|
74 | | - | let H = h(f) |
---|
75 | | - | if ((H == H)) |
---|
76 | | - | then $Tuple2([BinaryEntry(i, G), BinaryEntry(j, F), BinaryEntry(k, l), IntegerEntry(m, n)], unit) |
---|
| 85 | + | func init (K,J,p,r) = { |
---|
| 86 | + | let L = h(f) |
---|
| 87 | + | if ((L == L)) |
---|
| 88 | + | then $Tuple2([BinaryEntry(m, K), BinaryEntry(n, J), BinaryEntry(o, p), IntegerEntry(q, r)], unit) |
---|
77 | 89 | | else throw("Strict value is not equal to itself.") |
---|
78 | 90 | | } |
---|
79 | 91 | | |
---|
80 | 92 | | |
---|
81 | 93 | | |
---|
82 | 94 | | @Callable(f) |
---|
83 | | - | func request (B,C) = { |
---|
84 | | - | let r = toBase58String(sha256(((f.caller.bytes + B) + C))) |
---|
85 | | - | let I = [if ((size(f.payments) == 1)) |
---|
| 95 | + | func request (M,N) = { |
---|
| 96 | + | let v = makeString([toString(f.caller), M, N], ":") |
---|
| 97 | + | let F = j(M) |
---|
| 98 | + | let G = j(N) |
---|
| 99 | + | let O = [if ((size(f.payments) == 1)) |
---|
86 | 100 | | then true |
---|
87 | 101 | | else throw("1 payment is required"), if ((f.payments[0].assetId == unit)) |
---|
88 | 102 | | then true |
---|
89 | | - | else throw("invalid asset"), if ((f.payments[0].amount == n())) |
---|
| 103 | + | else throw("invalid asset"), if ((f.payments[0].amount == r())) |
---|
90 | 104 | | then true |
---|
91 | | - | else throw("invalid amount"), if (D(B, C)) |
---|
| 105 | + | else throw("invalid amount"), if (H(F, G)) |
---|
92 | 106 | | then true |
---|
93 | | - | else throw("pair is not allowed"), if ((getInteger(this, q(r)) == unit)) |
---|
| 107 | + | else throw("pair is not allowed"), if ((getInteger(this, u(v)) == unit)) |
---|
94 | 108 | | then true |
---|
95 | 109 | | else throw("account already exists")] |
---|
96 | | - | if ((I == I)) |
---|
97 | | - | then $Tuple2([IntegerEntry(q(r), 0), BinaryEntry(u(r), f.callerPublicKey), BinaryEntry(v(r), B), BinaryEntry(w(r), C)], unit) |
---|
| 110 | + | if ((O == O)) |
---|
| 111 | + | then $Tuple2([IntegerEntry(u(v), 0), BinaryEntry(y(v), f.callerPublicKey), StringEntry(z(v), M), StringEntry(A(v), N)], unit) |
---|
98 | 112 | | else throw("Strict value is not equal to itself.") |
---|
99 | 113 | | } |
---|
100 | 114 | | |
---|
101 | 115 | | |
---|
102 | 116 | | |
---|
103 | 117 | | @Callable(f) |
---|
104 | | - | func complete (r,J) = { |
---|
105 | | - | let K = f.callerPublicKey |
---|
106 | | - | let z = f.caller |
---|
107 | | - | let I = [if ((s(r) == o)) |
---|
| 118 | + | func complete (v,P) = { |
---|
| 119 | + | let Q = f.callerPublicKey |
---|
| 120 | + | let D = f.caller |
---|
| 121 | + | let O = [if ((w(v) == s)) |
---|
108 | 122 | | then true |
---|
109 | 123 | | else throw("account is already exists"), if ({ |
---|
110 | | - | let L = scriptHash(z) |
---|
111 | | - | if ($isInstanceOf(L, "ByteVector")) |
---|
| 124 | + | let R = scriptHash(D) |
---|
| 125 | + | if ($isInstanceOf(R, "ByteVector")) |
---|
112 | 126 | | then { |
---|
113 | | - | let M = L |
---|
114 | | - | (M == blake2b256_32Kb(l())) |
---|
| 127 | + | let S = R |
---|
| 128 | + | (S == blake2b256_32Kb(p())) |
---|
115 | 129 | | } |
---|
116 | 130 | | else false |
---|
117 | 131 | | }) |
---|
118 | 132 | | then true |
---|
119 | 133 | | else throw("invalid script")] |
---|
120 | | - | if ((I == I)) |
---|
| 134 | + | if ((O == O)) |
---|
121 | 135 | | then { |
---|
122 | | - | let N = addressFromPublicKey(J) |
---|
123 | | - | $Tuple2([IntegerEntry(q(r), p), BinaryEntry(t(r), J), BinaryEntry(x(r), K), StringEntry(y(z), r), ScriptTransfer(N, n(), unit)], unit) |
---|
| 136 | + | let T = addressFromPublicKey(P) |
---|
| 137 | + | $Tuple2([IntegerEntry(u(v), t), BinaryEntry(x(v), P), BinaryEntry(B(v), Q), StringEntry(C(D), v), ScriptTransfer(T, r(), unit)], unit) |
---|
124 | 138 | | } |
---|
125 | 139 | | else throw("Strict value is not equal to itself.") |
---|
126 | 140 | | } |
---|
Full:
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 | | - | let i = "%s__servicePublicKey" |
---|
| 20 | + | let i = "WAVES" |
---|
21 | 21 | | |
---|
22 | | - | let j = "%s__botPublicKey" |
---|
23 | | - | |
---|
24 | | - | let k = "%s__accountScript" |
---|
25 | | - | |
---|
26 | | - | func l () = valueOrErrorMessage(getBinary(this, k), "account script is not set") |
---|
| 22 | + | func j (k) = if ((k == i)) |
---|
| 23 | + | then unit |
---|
| 24 | + | else fromBase58String(k) |
---|
27 | 25 | | |
---|
28 | 26 | | |
---|
29 | | - | let m = "%s__rewardAmount" |
---|
30 | | - | |
---|
31 | | - | func n () = valueOrErrorMessage(getInteger(this, m), "reward amount is not set") |
---|
| 27 | + | func l (k) = if ((k == unit)) |
---|
| 28 | + | then i |
---|
| 29 | + | else toBase58String(value(k)) |
---|
32 | 30 | | |
---|
33 | 31 | | |
---|
34 | | - | let o = 0 |
---|
| 32 | + | let m = "%s__servicePublicKey" |
---|
35 | 33 | | |
---|
36 | | - | let p = 1 |
---|
| 34 | + | let n = "%s__botPublicKey" |
---|
37 | 35 | | |
---|
38 | | - | func q (r) = makeString(["%s%s", r, "status"], a) |
---|
| 36 | + | let o = "%s__accountScript" |
---|
| 37 | + | |
---|
| 38 | + | func p () = valueOrErrorMessage(getBinary(this, o), "account script is not set") |
---|
39 | 39 | | |
---|
40 | 40 | | |
---|
41 | | - | func s (r) = valueOrErrorMessage(getInteger(this, q(r)), "account is not found") |
---|
| 41 | + | let q = "%s__rewardAmount" |
---|
| 42 | + | |
---|
| 43 | + | func r () = valueOrErrorMessage(getInteger(this, q), "reward amount is not set") |
---|
42 | 44 | | |
---|
43 | 45 | | |
---|
44 | | - | func t (r) = makeString(["%s%s", r, "creatorPublicKey"], a) |
---|
| 46 | + | let s = 0 |
---|
| 47 | + | |
---|
| 48 | + | let t = 1 |
---|
| 49 | + | |
---|
| 50 | + | func u (v) = makeString(["%s%s", v, "status"], a) |
---|
45 | 51 | | |
---|
46 | 52 | | |
---|
47 | | - | func u (r) = makeString(["%s%s", r, "ownerPublicKey"], a) |
---|
| 53 | + | func w (v) = valueOrErrorMessage(getInteger(this, u(v)), "account is not found") |
---|
48 | 54 | | |
---|
49 | 55 | | |
---|
50 | | - | func v (r) = makeString(["%s%s", r, "amountAssetId"], a) |
---|
| 56 | + | func x (v) = makeString(["%s%s", v, "creatorPublicKey"], a) |
---|
51 | 57 | | |
---|
52 | 58 | | |
---|
53 | | - | func w (r) = makeString(["%s%s", r, "priceAssetId"], a) |
---|
| 59 | + | func y (v) = makeString(["%s%s", v, "ownerPublicKey"], a) |
---|
54 | 60 | | |
---|
55 | 61 | | |
---|
56 | | - | func x (r) = makeString(["%s%s", r, "accountIdToAccountPublicKey"], a) |
---|
| 62 | + | func z (v) = makeString(["%s%s", v, "amountAssetId"], a) |
---|
57 | 63 | | |
---|
58 | 64 | | |
---|
59 | | - | func y (z) = makeString(["%s%s", toString(z), "accountAddressToAccountId"], a) |
---|
| 65 | + | func A (v) = makeString(["%s%s", v, "priceAssetId"], a) |
---|
60 | 66 | | |
---|
61 | 67 | | |
---|
62 | | - | func A (B,C) = makeString(["%s%s%s", toBase58String(B), toBase58String(C), "pairAllowed"], a) |
---|
| 68 | + | func B (v) = makeString(["%s%s", v, "accountIdToAccountPublicKey"], a) |
---|
63 | 69 | | |
---|
64 | 70 | | |
---|
65 | | - | func D (B,C) = valueOrElse(getBoolean(this, A(B, C)), false) |
---|
| 71 | + | func C (D) = makeString(["%s%s", toString(D), "accountAddressToAccountId"], a) |
---|
66 | 72 | | |
---|
67 | 73 | | |
---|
68 | | - | let E = addressFromPublicKey(getBinaryValue(this, i)) |
---|
| 74 | + | func E (F,G) = makeString(["%s%s%s", l(F), l(G), "pairAllowed"], a) |
---|
69 | 75 | | |
---|
70 | | - | let F = getBinaryValue(this, j) |
---|
| 76 | + | |
---|
| 77 | + | func H (F,G) = valueOrElse(getBoolean(this, E(F, G)), false) |
---|
| 78 | + | |
---|
| 79 | + | |
---|
| 80 | + | let I = addressFromPublicKey(getBinaryValue(this, m)) |
---|
| 81 | + | |
---|
| 82 | + | let J = getBinaryValue(this, n) |
---|
71 | 83 | | |
---|
72 | 84 | | @Callable(f) |
---|
73 | | - | func init (G,F,l,n) = { |
---|
74 | | - | let H = h(f) |
---|
75 | | - | if ((H == H)) |
---|
76 | | - | then $Tuple2([BinaryEntry(i, G), BinaryEntry(j, F), BinaryEntry(k, l), IntegerEntry(m, n)], unit) |
---|
| 85 | + | func init (K,J,p,r) = { |
---|
| 86 | + | let L = h(f) |
---|
| 87 | + | if ((L == L)) |
---|
| 88 | + | then $Tuple2([BinaryEntry(m, K), BinaryEntry(n, J), BinaryEntry(o, p), IntegerEntry(q, r)], unit) |
---|
77 | 89 | | else throw("Strict value is not equal to itself.") |
---|
78 | 90 | | } |
---|
79 | 91 | | |
---|
80 | 92 | | |
---|
81 | 93 | | |
---|
82 | 94 | | @Callable(f) |
---|
83 | | - | func request (B,C) = { |
---|
84 | | - | let r = toBase58String(sha256(((f.caller.bytes + B) + C))) |
---|
85 | | - | let I = [if ((size(f.payments) == 1)) |
---|
| 95 | + | func request (M,N) = { |
---|
| 96 | + | let v = makeString([toString(f.caller), M, N], ":") |
---|
| 97 | + | let F = j(M) |
---|
| 98 | + | let G = j(N) |
---|
| 99 | + | let O = [if ((size(f.payments) == 1)) |
---|
86 | 100 | | then true |
---|
87 | 101 | | else throw("1 payment is required"), if ((f.payments[0].assetId == unit)) |
---|
88 | 102 | | then true |
---|
89 | | - | else throw("invalid asset"), if ((f.payments[0].amount == n())) |
---|
| 103 | + | else throw("invalid asset"), if ((f.payments[0].amount == r())) |
---|
90 | 104 | | then true |
---|
91 | | - | else throw("invalid amount"), if (D(B, C)) |
---|
| 105 | + | else throw("invalid amount"), if (H(F, G)) |
---|
92 | 106 | | then true |
---|
93 | | - | else throw("pair is not allowed"), if ((getInteger(this, q(r)) == unit)) |
---|
| 107 | + | else throw("pair is not allowed"), if ((getInteger(this, u(v)) == unit)) |
---|
94 | 108 | | then true |
---|
95 | 109 | | else throw("account already exists")] |
---|
96 | | - | if ((I == I)) |
---|
97 | | - | then $Tuple2([IntegerEntry(q(r), 0), BinaryEntry(u(r), f.callerPublicKey), BinaryEntry(v(r), B), BinaryEntry(w(r), C)], unit) |
---|
| 110 | + | if ((O == O)) |
---|
| 111 | + | then $Tuple2([IntegerEntry(u(v), 0), BinaryEntry(y(v), f.callerPublicKey), StringEntry(z(v), M), StringEntry(A(v), N)], unit) |
---|
98 | 112 | | else throw("Strict value is not equal to itself.") |
---|
99 | 113 | | } |
---|
100 | 114 | | |
---|
101 | 115 | | |
---|
102 | 116 | | |
---|
103 | 117 | | @Callable(f) |
---|
104 | | - | func complete (r,J) = { |
---|
105 | | - | let K = f.callerPublicKey |
---|
106 | | - | let z = f.caller |
---|
107 | | - | let I = [if ((s(r) == o)) |
---|
| 118 | + | func complete (v,P) = { |
---|
| 119 | + | let Q = f.callerPublicKey |
---|
| 120 | + | let D = f.caller |
---|
| 121 | + | let O = [if ((w(v) == s)) |
---|
108 | 122 | | then true |
---|
109 | 123 | | else throw("account is already exists"), if ({ |
---|
110 | | - | let L = scriptHash(z) |
---|
111 | | - | if ($isInstanceOf(L, "ByteVector")) |
---|
| 124 | + | let R = scriptHash(D) |
---|
| 125 | + | if ($isInstanceOf(R, "ByteVector")) |
---|
112 | 126 | | then { |
---|
113 | | - | let M = L |
---|
114 | | - | (M == blake2b256_32Kb(l())) |
---|
| 127 | + | let S = R |
---|
| 128 | + | (S == blake2b256_32Kb(p())) |
---|
115 | 129 | | } |
---|
116 | 130 | | else false |
---|
117 | 131 | | }) |
---|
118 | 132 | | then true |
---|
119 | 133 | | else throw("invalid script")] |
---|
120 | | - | if ((I == I)) |
---|
| 134 | + | if ((O == O)) |
---|
121 | 135 | | then { |
---|
122 | | - | let N = addressFromPublicKey(J) |
---|
123 | | - | $Tuple2([IntegerEntry(q(r), p), BinaryEntry(t(r), J), BinaryEntry(x(r), K), StringEntry(y(z), r), ScriptTransfer(N, n(), unit)], unit) |
---|
| 136 | + | let T = addressFromPublicKey(P) |
---|
| 137 | + | $Tuple2([IntegerEntry(u(v), t), BinaryEntry(x(v), P), BinaryEntry(B(v), Q), StringEntry(C(D), v), ScriptTransfer(T, r(), unit)], unit) |
---|
124 | 138 | | } |
---|
125 | 139 | | else throw("Strict value is not equal to itself.") |
---|
126 | 140 | | } |
---|
127 | 141 | | |
---|
128 | 142 | | |
---|