tx · FVzZgwHLVW79Tz8ymrpPrZEWTi3PNoEiLXGj43m5aiGD
3N91zFrRoofbPpkoDbWKrQsQSdLu2EgLL8c: -0.01000000 Waves
2023.09.27 14:41 [2773766] smart account 3N91zFrRoofbPpkoDbWKrQsQSdLu2EgLL8c > SELF 0.00000000 Waves
{
"type": 13,
"id": "FVzZgwHLVW79Tz8ymrpPrZEWTi3PNoEiLXGj43m5aiGD",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1695814951951,
"version": 2,
"chainId": 84,
"sender": "3N91zFrRoofbPpkoDbWKrQsQSdLu2EgLL8c",
"senderPublicKey": "5FyjUYCR5Q8jvG6ri6Ysz574HerUK6r1LJzzQ7DvSkLk",
"proofs": [
"2ao693y8R6ZRQDVyaUvw6XNLPN6GQimm1d9hwCCygZQb7BuGqxywdvMNoAAvHd1Zj12yhvze7PwxhnRs8W4WAXEB"
],
"script": "base64:BgISCAISBgoEAgICARIAEgQKAggCFAAJc2VwYXJhdG9yAgJfXwELbXVzdEFkZHJlc3MCAWkHYWRkcmVzcwMJAAACCAUBaQZjYWxsZXIFB2FkZHJlc3MGCQEFdGhyb3cAAQhtdXN0VGhpcwEBaQkBC211c3RBZGRyZXNzAgUBaQUEdGhpcwARa1NlcnZpY2VQdWJsaWNLZXkCFCVzX19zZXJ2aWNlUHVibGljS2V5AA1rQm90UHVibGljS2V5AhAlc19fYm90UHVibGljS2V5ABFrRmFjdG9yeVB1YmxpY0tleQIUJXNfX2ZhY3RvcnlQdWJsaWNLZXkAD2tPd25lclB1YmxpY0tleQISJXNfX293bmVyUHVibGljS2V5ABFrQ3JlYXRvclB1YmxpY0tleQIUJXNfX2NyZWF0b3JQdWJsaWNLZXkAEmtBY2NvdW50U2NyaXB0SGFzaAIVJXNfX2FjY291bnRTY3JpcHRIYXNoARFhY2NvdW50U2NyaXB0SGFzaAAJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnAgCBQR0aGlzBRJrQWNjb3VudFNjcmlwdEhhc2g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BQ5hY2NvdW50QWRkcmVzcwIHYXBwcm92ZQUDbmlsBQNuaWwJAJQKAgkAzAgCCQEMQm9vbGVhbkVudHJ5AgkBEWtSZXF1ZXN0Q29tcGxldGVkAQUJcmVxdWVzdElkBgkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDBQ5jcmVhdG9yQWRkcmVzcwkBDHJld2FyZEFtb3VudAAFBHVuaXQFA25pbAUGcmVzdWx0CQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuABY5TBs=",
"height": 2773766,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: CBmUfgwJ6H3VyFs6q2MJ4F6Z2qmiJ2E6NtJVDTCz2sVJ
Next: 52UDy65RNS29aikC2CuuPbHQjnq13HFAUit4vngCNody
Diff:
Old | New | | Differences |
---|
19 | 19 | | |
---|
20 | 20 | | let i = "%s__ownerPublicKey" |
---|
21 | 21 | | |
---|
22 | | - | let j = "%s__accountScriptHash" |
---|
| 22 | + | let j = "%s__creatorPublicKey" |
---|
23 | 23 | | |
---|
24 | | - | func k () = valueOrErrorMessage(getBinary(this, j), "account script hash is not set") |
---|
| 24 | + | let k = "%s__accountScriptHash" |
---|
| 25 | + | |
---|
| 26 | + | func l () = valueOrErrorMessage(getBinary(this, k), "account script hash is not set") |
---|
25 | 27 | | |
---|
26 | 28 | | |
---|
27 | | - | let l = "%s__counter" |
---|
| 29 | + | let m = "%s__counter" |
---|
28 | 30 | | |
---|
29 | | - | func m () = valueOrElse(getInteger(this, l), 0) |
---|
| 31 | + | func n () = valueOrElse(getInteger(this, m), 0) |
---|
30 | 32 | | |
---|
31 | 33 | | |
---|
32 | | - | let n = "%s__rewardAmount" |
---|
| 34 | + | let o = "%s__rewardAmount" |
---|
33 | 35 | | |
---|
34 | | - | func o () = valueOrErrorMessage(getInteger(this, n), "reward amount is not set") |
---|
| 36 | + | func p () = valueOrErrorMessage(getInteger(this, o), "reward amount is not set") |
---|
35 | 37 | | |
---|
36 | 38 | | |
---|
37 | | - | func p (q) = makeString(["%s%s", q, "completed"], a) |
---|
| 39 | + | func q (r) = makeString(["%s%s", r, "completed"], a) |
---|
38 | 40 | | |
---|
39 | 41 | | |
---|
40 | | - | func r (q) = valueOrErrorMessage(getBoolean(this, p(q)), "request is not found") |
---|
| 42 | + | func s (r) = valueOrErrorMessage(getBoolean(this, q(r)), "request is not found") |
---|
41 | 43 | | |
---|
42 | 44 | | |
---|
43 | | - | func s (q) = makeString(["%s%s", q, "owner"], a) |
---|
| 45 | + | func t (r) = makeString(["%s%s", r, "owner"], a) |
---|
44 | 46 | | |
---|
45 | 47 | | |
---|
46 | | - | func t (q) = valueOrErrorMessage(getBinary(this, s(q)), "request is not found") |
---|
| 48 | + | func u (r) = valueOrErrorMessage(getBinary(this, t(r)), "request is not found") |
---|
47 | 49 | | |
---|
48 | 50 | | |
---|
49 | | - | let u = addressFromPublicKey(getBinaryValue(this, f)) |
---|
| 51 | + | let v = addressFromPublicKey(getBinaryValue(this, f)) |
---|
50 | 52 | | |
---|
51 | | - | let v = getBinaryValue(this, g) |
---|
| 53 | + | let w = getBinaryValue(this, g) |
---|
52 | 54 | | |
---|
53 | 55 | | @Callable(c) |
---|
54 | | - | func init (w,v,k,o) = { |
---|
55 | | - | let x = e(c) |
---|
56 | | - | if ((x == x)) |
---|
57 | | - | then $Tuple2([BinaryEntry(f, w), BinaryEntry(g, v), BinaryEntry(j, k), IntegerEntry(n, o)], unit) |
---|
| 56 | + | func init (x,w,l,p) = { |
---|
| 57 | + | let y = e(c) |
---|
| 58 | + | if ((y == y)) |
---|
| 59 | + | then $Tuple2([BinaryEntry(f, x), BinaryEntry(g, w), BinaryEntry(k, l), IntegerEntry(o, p)], unit) |
---|
58 | 60 | | else throw("Strict value is not equal to itself.") |
---|
59 | 61 | | } |
---|
60 | 62 | | |
---|
|
62 | 64 | | |
---|
63 | 65 | | @Callable(c) |
---|
64 | 66 | | func request () = { |
---|
65 | | - | let y = [if ((size(c.payments) == 1)) |
---|
| 67 | + | let z = [if ((size(c.payments) == 1)) |
---|
66 | 68 | | then true |
---|
67 | 69 | | else throw("1 payment is required"), if ((c.payments[0].assetId == unit)) |
---|
68 | 70 | | then true |
---|
69 | | - | else throw("invalid asset"), if ((c.payments[0].amount == o())) |
---|
| 71 | + | else throw("invalid asset"), if ((c.payments[0].amount == p())) |
---|
70 | 72 | | then true |
---|
71 | 73 | | else throw("invalid amount")] |
---|
72 | | - | if ((y == y)) |
---|
| 74 | + | if ((z == z)) |
---|
73 | 75 | | then { |
---|
74 | | - | let q = toBase58String(sha256((c.caller.bytes + toBytes(m())))) |
---|
75 | | - | $Tuple2([BooleanEntry(p(q), false), BinaryEntry(s(q), c.callerPublicKey), IntegerEntry(l, (m() + 1))], unit) |
---|
| 76 | + | let r = toBase58String(sha256((c.caller.bytes + toBytes(n())))) |
---|
| 77 | + | $Tuple2([BooleanEntry(q(r), false), BinaryEntry(t(r), c.callerPublicKey), IntegerEntry(m, (n() + 1))], unit) |
---|
76 | 78 | | } |
---|
77 | 79 | | else throw("Strict value is not equal to itself.") |
---|
78 | 80 | | } |
---|
|
80 | 82 | | |
---|
81 | 83 | | |
---|
82 | 84 | | @Callable(c) |
---|
83 | | - | func complete (q,z) = { |
---|
84 | | - | let y = [if (!(r(q))) |
---|
| 85 | + | func complete (r,A) = { |
---|
| 86 | + | let z = [if (!(s(r))) |
---|
85 | 87 | | then true |
---|
86 | | - | else throw("request is already completed"), if ((scriptHash(c.caller) == k())) |
---|
| 88 | + | else throw("request is already completed"), if ((scriptHash(c.caller) == l())) |
---|
87 | 89 | | then true |
---|
88 | 90 | | else throw("invalid script"), if ({ |
---|
89 | | - | let A = getBinary(c.caller, h) |
---|
90 | | - | if ($isInstanceOf(A, "ByteVector")) |
---|
| 91 | + | let B = getBinary(c.caller, h) |
---|
| 92 | + | if ($isInstanceOf(B, "ByteVector")) |
---|
91 | 93 | | then { |
---|
92 | | - | let B = A |
---|
93 | | - | (addressFromPublicKey(B) == this) |
---|
| 94 | + | let C = B |
---|
| 95 | + | (addressFromPublicKey(C) == this) |
---|
94 | 96 | | } |
---|
95 | 97 | | else false |
---|
96 | 98 | | }) |
---|
97 | 99 | | then true |
---|
98 | 100 | | else throw("invalid factory public key"), if ({ |
---|
99 | | - | let A = getBinary(c.caller, i) |
---|
100 | | - | if ($isInstanceOf(A, "ByteVector")) |
---|
| 101 | + | let B = getBinary(c.caller, i) |
---|
| 102 | + | if ($isInstanceOf(B, "ByteVector")) |
---|
101 | 103 | | then { |
---|
102 | | - | let B = A |
---|
103 | | - | (B == t(q)) |
---|
| 104 | + | let C = B |
---|
| 105 | + | (C == u(r)) |
---|
104 | 106 | | } |
---|
105 | 107 | | else false |
---|
106 | 108 | | }) |
---|
107 | 109 | | then true |
---|
108 | 110 | | else throw("invalid owner public key")] |
---|
109 | | - | if ((y == y)) |
---|
| 111 | + | if ((z == z)) |
---|
110 | 112 | | then { |
---|
111 | | - | let C = reentrantInvoke(c.caller, "approve", nil, nil) |
---|
112 | | - | $Tuple2([BooleanEntry(p(q), true)], C) |
---|
| 113 | + | let D = addressFromPublicKey(A) |
---|
| 114 | + | let E = valueOrErrorMessage(getBinary(D, j), "creator public key is not set") |
---|
| 115 | + | let F = addressFromPublicKey(E) |
---|
| 116 | + | let G = invoke(D, "approve", nil, nil) |
---|
| 117 | + | $Tuple2([BooleanEntry(q(r), true), ScriptTransfer(F, p(), unit)], G) |
---|
113 | 118 | | } |
---|
114 | 119 | | else throw("Strict value is not equal to itself.") |
---|
115 | 120 | | } |
---|
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 | | func b (c,d) = if ((c.caller == d)) |
---|
7 | 7 | | then true |
---|
8 | 8 | | else throw() |
---|
9 | 9 | | |
---|
10 | 10 | | |
---|
11 | 11 | | func e (c) = b(c, this) |
---|
12 | 12 | | |
---|
13 | 13 | | |
---|
14 | 14 | | let f = "%s__servicePublicKey" |
---|
15 | 15 | | |
---|
16 | 16 | | let g = "%s__botPublicKey" |
---|
17 | 17 | | |
---|
18 | 18 | | let h = "%s__factoryPublicKey" |
---|
19 | 19 | | |
---|
20 | 20 | | let i = "%s__ownerPublicKey" |
---|
21 | 21 | | |
---|
22 | | - | let j = "%s__accountScriptHash" |
---|
| 22 | + | let j = "%s__creatorPublicKey" |
---|
23 | 23 | | |
---|
24 | | - | func k () = valueOrErrorMessage(getBinary(this, j), "account script hash is not set") |
---|
| 24 | + | let k = "%s__accountScriptHash" |
---|
| 25 | + | |
---|
| 26 | + | func l () = valueOrErrorMessage(getBinary(this, k), "account script hash is not set") |
---|
25 | 27 | | |
---|
26 | 28 | | |
---|
27 | | - | let l = "%s__counter" |
---|
| 29 | + | let m = "%s__counter" |
---|
28 | 30 | | |
---|
29 | | - | func m () = valueOrElse(getInteger(this, l), 0) |
---|
| 31 | + | func n () = valueOrElse(getInteger(this, m), 0) |
---|
30 | 32 | | |
---|
31 | 33 | | |
---|
32 | | - | let n = "%s__rewardAmount" |
---|
| 34 | + | let o = "%s__rewardAmount" |
---|
33 | 35 | | |
---|
34 | | - | func o () = valueOrErrorMessage(getInteger(this, n), "reward amount is not set") |
---|
| 36 | + | func p () = valueOrErrorMessage(getInteger(this, o), "reward amount is not set") |
---|
35 | 37 | | |
---|
36 | 38 | | |
---|
37 | | - | func p (q) = makeString(["%s%s", q, "completed"], a) |
---|
| 39 | + | func q (r) = makeString(["%s%s", r, "completed"], a) |
---|
38 | 40 | | |
---|
39 | 41 | | |
---|
40 | | - | func r (q) = valueOrErrorMessage(getBoolean(this, p(q)), "request is not found") |
---|
| 42 | + | func s (r) = valueOrErrorMessage(getBoolean(this, q(r)), "request is not found") |
---|
41 | 43 | | |
---|
42 | 44 | | |
---|
43 | | - | func s (q) = makeString(["%s%s", q, "owner"], a) |
---|
| 45 | + | func t (r) = makeString(["%s%s", r, "owner"], a) |
---|
44 | 46 | | |
---|
45 | 47 | | |
---|
46 | | - | func t (q) = valueOrErrorMessage(getBinary(this, s(q)), "request is not found") |
---|
| 48 | + | func u (r) = valueOrErrorMessage(getBinary(this, t(r)), "request is not found") |
---|
47 | 49 | | |
---|
48 | 50 | | |
---|
49 | | - | let u = addressFromPublicKey(getBinaryValue(this, f)) |
---|
| 51 | + | let v = addressFromPublicKey(getBinaryValue(this, f)) |
---|
50 | 52 | | |
---|
51 | | - | let v = getBinaryValue(this, g) |
---|
| 53 | + | let w = getBinaryValue(this, g) |
---|
52 | 54 | | |
---|
53 | 55 | | @Callable(c) |
---|
54 | | - | func init (w,v,k,o) = { |
---|
55 | | - | let x = e(c) |
---|
56 | | - | if ((x == x)) |
---|
57 | | - | then $Tuple2([BinaryEntry(f, w), BinaryEntry(g, v), BinaryEntry(j, k), IntegerEntry(n, o)], unit) |
---|
| 56 | + | func init (x,w,l,p) = { |
---|
| 57 | + | let y = e(c) |
---|
| 58 | + | if ((y == y)) |
---|
| 59 | + | then $Tuple2([BinaryEntry(f, x), BinaryEntry(g, w), BinaryEntry(k, l), IntegerEntry(o, p)], unit) |
---|
58 | 60 | | else throw("Strict value is not equal to itself.") |
---|
59 | 61 | | } |
---|
60 | 62 | | |
---|
61 | 63 | | |
---|
62 | 64 | | |
---|
63 | 65 | | @Callable(c) |
---|
64 | 66 | | func request () = { |
---|
65 | | - | let y = [if ((size(c.payments) == 1)) |
---|
| 67 | + | let z = [if ((size(c.payments) == 1)) |
---|
66 | 68 | | then true |
---|
67 | 69 | | else throw("1 payment is required"), if ((c.payments[0].assetId == unit)) |
---|
68 | 70 | | then true |
---|
69 | | - | else throw("invalid asset"), if ((c.payments[0].amount == o())) |
---|
| 71 | + | else throw("invalid asset"), if ((c.payments[0].amount == p())) |
---|
70 | 72 | | then true |
---|
71 | 73 | | else throw("invalid amount")] |
---|
72 | | - | if ((y == y)) |
---|
| 74 | + | if ((z == z)) |
---|
73 | 75 | | then { |
---|
74 | | - | let q = toBase58String(sha256((c.caller.bytes + toBytes(m())))) |
---|
75 | | - | $Tuple2([BooleanEntry(p(q), false), BinaryEntry(s(q), c.callerPublicKey), IntegerEntry(l, (m() + 1))], unit) |
---|
| 76 | + | let r = toBase58String(sha256((c.caller.bytes + toBytes(n())))) |
---|
| 77 | + | $Tuple2([BooleanEntry(q(r), false), BinaryEntry(t(r), c.callerPublicKey), IntegerEntry(m, (n() + 1))], unit) |
---|
76 | 78 | | } |
---|
77 | 79 | | else throw("Strict value is not equal to itself.") |
---|
78 | 80 | | } |
---|
79 | 81 | | |
---|
80 | 82 | | |
---|
81 | 83 | | |
---|
82 | 84 | | @Callable(c) |
---|
83 | | - | func complete (q,z) = { |
---|
84 | | - | let y = [if (!(r(q))) |
---|
| 85 | + | func complete (r,A) = { |
---|
| 86 | + | let z = [if (!(s(r))) |
---|
85 | 87 | | then true |
---|
86 | | - | else throw("request is already completed"), if ((scriptHash(c.caller) == k())) |
---|
| 88 | + | else throw("request is already completed"), if ((scriptHash(c.caller) == l())) |
---|
87 | 89 | | then true |
---|
88 | 90 | | else throw("invalid script"), if ({ |
---|
89 | | - | let A = getBinary(c.caller, h) |
---|
90 | | - | if ($isInstanceOf(A, "ByteVector")) |
---|
| 91 | + | let B = getBinary(c.caller, h) |
---|
| 92 | + | if ($isInstanceOf(B, "ByteVector")) |
---|
91 | 93 | | then { |
---|
92 | | - | let B = A |
---|
93 | | - | (addressFromPublicKey(B) == this) |
---|
| 94 | + | let C = B |
---|
| 95 | + | (addressFromPublicKey(C) == this) |
---|
94 | 96 | | } |
---|
95 | 97 | | else false |
---|
96 | 98 | | }) |
---|
97 | 99 | | then true |
---|
98 | 100 | | else throw("invalid factory public key"), if ({ |
---|
99 | | - | let A = getBinary(c.caller, i) |
---|
100 | | - | if ($isInstanceOf(A, "ByteVector")) |
---|
| 101 | + | let B = getBinary(c.caller, i) |
---|
| 102 | + | if ($isInstanceOf(B, "ByteVector")) |
---|
101 | 103 | | then { |
---|
102 | | - | let B = A |
---|
103 | | - | (B == t(q)) |
---|
| 104 | + | let C = B |
---|
| 105 | + | (C == u(r)) |
---|
104 | 106 | | } |
---|
105 | 107 | | else false |
---|
106 | 108 | | }) |
---|
107 | 109 | | then true |
---|
108 | 110 | | else throw("invalid owner public key")] |
---|
109 | | - | if ((y == y)) |
---|
| 111 | + | if ((z == z)) |
---|
110 | 112 | | then { |
---|
111 | | - | let C = reentrantInvoke(c.caller, "approve", nil, nil) |
---|
112 | | - | $Tuple2([BooleanEntry(p(q), true)], C) |
---|
| 113 | + | let D = addressFromPublicKey(A) |
---|
| 114 | + | let E = valueOrErrorMessage(getBinary(D, j), "creator public key is not set") |
---|
| 115 | + | let F = addressFromPublicKey(E) |
---|
| 116 | + | let G = invoke(D, "approve", nil, nil) |
---|
| 117 | + | $Tuple2([BooleanEntry(q(r), true), ScriptTransfer(F, p(), unit)], G) |
---|
113 | 118 | | } |
---|
114 | 119 | | else throw("Strict value is not equal to itself.") |
---|
115 | 120 | | } |
---|
116 | 121 | | |
---|
117 | 122 | | |
---|