tx · CZ8itX1YtgkepHrXNdaTiwCLztwv3ZPYbUueQ84sVijD 3MyLnBsVm9pw43K9eba5UExxb3efeai91KP: -0.01000000 Waves 2022.12.22 15:47 [2371521] smart account 3MyLnBsVm9pw43K9eba5UExxb3efeai91KP > SELF 0.00000000 Waves
{ "type": 13, "id": "CZ8itX1YtgkepHrXNdaTiwCLztwv3ZPYbUueQ84sVijD", "fee": 1000000, "feeAssetId": null, "timestamp": 1671713266383, "version": 2, "chainId": 84, "sender": "3MyLnBsVm9pw43K9eba5UExxb3efeai91KP", "senderPublicKey": "E5xdZLn3yHKAn29pTyubhr9R1mkRGg9WKAcpPrCYFYHx", "proofs": [ "31morfdVKZFFFTGQ3Lp7fz1tXXogvmmyEBebLGmD7vLD7LqWhXCHsuyChrgHG3uGoAv4AZ8Z3MDYVUTcwbtrQZXv" ], "script": "base64:AAIFAAAAAAAAACIIAhIDCgEEEgASCQoHCAgIAQEIARIDCgEBEgASABIDCgEIAAAAEQAAAAAGYWRtUHViAQAAACDCbSeYCFZIOpb4r9LWa8L402jDi6OfxQF86gIW2LZmcwAAAAAMcGF5bWVudEFzc2V0AQAAACAhOUTpKXxfz4r4M5I49SS+rwv2+rnVA49FLcaoUr/6uQAAAAALc2h1dERvd25LZXkCAAAACl9zaHV0RG93bl8AAAAACGV2ZW50S2V5AgAAAAdfZXZlbnRfAAAAAApwYXltZW50S2V5AgAAAAlfcGF5bWVudF8AAAAAEGdsb2JhbEV2ZW50SWRLZXkCAAAACV9ldmVudElkXwAAAAANc3RhcnRCbG9ja0tleQIAAAAMX3N0YXJ0QmxvY2tfAAAAAAtlbmRCbG9ja0tleQIAAAAKX2VuZEJsb2NrXwAAAAAIaW1hZ2VLZXkCAAAAB19pbWFnZV8AAAAACG93bmVyS2V5AgAAAAdfb3duZXJfAAAAAAZ1cmxLZXkCAAAABV91cmxfAAAAAApoYXJkQ2FwS2V5AgAAAAlfaGFyZENhcF8AAAAACHRpdGxlS2V5AgAAAAdfdGl0bGVfA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AAAAAAAggFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5BQAAAAZhZG1QdWIJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAADa2V5BQAAAANuaWwJAAACAAAAAQIAAAAfeW91IGFyZSBub3QgYWxsb3dlZCB0byBkbyB0aGlzIQAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5o1CYDg==", "height": 2371521, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8Wcznytk6JB1VENMz98LymQHRiWrcVxJqA3ACvKTC81F Next: Edf3zztHwQbf29tdqpPKTnhCgKeWrVcWfMNUN9PuV62c Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | let b = base58'3Eh6z6z6ouFpWxGKrPaPnZwmDnDjgYHV6tqCmZf2G7tk' | |
7 | 7 | ||
8 | - | let c = "_ | |
8 | + | let c = "_shutDown_" | |
9 | 9 | ||
10 | - | let d = "_ | |
10 | + | let d = "_event_" | |
11 | 11 | ||
12 | - | let e = "_ | |
12 | + | let e = "_payment_" | |
13 | 13 | ||
14 | - | let f = "_ | |
14 | + | let f = "_eventId_" | |
15 | 15 | ||
16 | - | let g = "_ | |
16 | + | let g = "_startBlock_" | |
17 | 17 | ||
18 | - | let h = "_ | |
18 | + | let h = "_endBlock_" | |
19 | 19 | ||
20 | - | let i = "_ | |
20 | + | let i = "_image_" | |
21 | 21 | ||
22 | - | let j = "_ | |
22 | + | let j = "_owner_" | |
23 | 23 | ||
24 | - | let k = "_ | |
24 | + | let k = "_url_" | |
25 | 25 | ||
26 | - | let l = "_ | |
26 | + | let l = "_hardCap_" | |
27 | 27 | ||
28 | - | let m = "_ | |
28 | + | let m = "_title_" | |
29 | 29 | ||
30 | - | let n = "_ | |
30 | + | let n = "_shareHolderCount_" | |
31 | 31 | ||
32 | - | let o = "_ | |
32 | + | let o = "_totalPayment_" | |
33 | 33 | ||
34 | - | func p (q) = { | |
35 | - | let r = b | |
36 | - | if ((size(q.payments) == 0)) | |
34 | + | let p = "_walletPayment_" | |
35 | + | ||
36 | + | func q (r) = { | |
37 | + | let s = b | |
38 | + | if ((size(r.payments) == 0)) | |
37 | 39 | then throw("Payment not attached") | |
38 | 40 | else { | |
39 | - | let | |
40 | - | let | |
41 | - | if ($isInstanceOf( | |
41 | + | let t = r.payments[0] | |
42 | + | let u = t.assetId | |
43 | + | if ($isInstanceOf(u, "ByteVector")) | |
42 | 44 | then { | |
43 | - | let | |
44 | - | if (( | |
45 | - | then ( | |
45 | + | let v = u | |
46 | + | if ((v == s)) | |
47 | + | then (t.amount > 0) | |
46 | 48 | else false | |
47 | 49 | } | |
48 | 50 | else throw("Wrong payment asset") | |
50 | 52 | } | |
51 | 53 | ||
52 | 54 | ||
53 | - | @Callable(q) | |
54 | - | func shutdown () = throw("shutdown") | |
55 | + | @Callable(r) | |
56 | + | func shutdown (w) = { | |
57 | + | let x = valueOrElse(getBoolean(this, c), true) | |
58 | + | if ((r.callerPublicKey == a)) | |
59 | + | then [BooleanEntry(c, x)] | |
60 | + | else throw("you are not allow to do this!") | |
61 | + | } | |
55 | 62 | ||
56 | 63 | ||
57 | 64 | ||
58 | - | @Callable( | |
65 | + | @Callable(r) | |
59 | 66 | func settings () = throw("settings") | |
60 | 67 | ||
61 | 68 | ||
62 | 69 | ||
63 | - | @Callable( | |
64 | - | func create ( | |
65 | - | let | |
66 | - | let | |
67 | - | if (( | |
68 | - | then [StringEntry((( | |
70 | + | @Callable(r) | |
71 | + | func create (y,z,A,B,C,D,E) = { | |
72 | + | let F = valueOrElse(getInteger(this, f), 0) | |
73 | + | let G = (F + 1) | |
74 | + | if ((r.callerPublicKey == a)) | |
75 | + | then [StringEntry(((d + i) + toString(G)), z), StringEntry(((d + j) + toString(G)), A), StringEntry(((d + m) + toString(G)), y), IntegerEntry(((d + g) + toString(G)), B), IntegerEntry(((d + h) + toString(G)), C), StringEntry(((d + k) + toString(G)), D), IntegerEntry(((d + l) + toString(G)), E), IntegerEntry((d + f), G)] | |
69 | 76 | else throw("you are not allowed") | |
70 | 77 | } | |
71 | 78 | ||
72 | 79 | ||
73 | 80 | ||
74 | - | @Callable( | |
75 | - | func funding ( | |
76 | - | let | |
77 | - | let | |
78 | - | let | |
79 | - | let | |
80 | - | let | |
81 | - | let | |
82 | - | let | |
83 | - | if (( | |
81 | + | @Callable(r) | |
82 | + | func funding (F) = { | |
83 | + | let B = valueOrErrorMessage(getInteger(this, ((d + g) + toString(F))), "err") | |
84 | + | let C = valueOrErrorMessage(getInteger(this, ((d + h) + toString(F))), "err") | |
85 | + | let E = valueOrErrorMessage(getInteger(this, ((d + l) + toString(F))), "err") | |
86 | + | let H = toBase58String(r.caller.bytes) | |
87 | + | let I = valueOrElse(getInteger(this, ((e + o) + toString(F))), 0) | |
88 | + | let J = valueOrElse(getInteger(this, (((e + p) + H) + toString(F))), 0) | |
89 | + | let K = valueOrElse(getInteger(this, ((e + n) + toString(F))), 0) | |
90 | + | if ((B > height)) | |
84 | 91 | then throw("crowdfunding not started") | |
85 | - | else if ((height >= | |
92 | + | else if ((height >= C)) | |
86 | 93 | then throw("crowdfunding is over") | |
87 | - | else if (( | |
94 | + | else if ((I >= E)) | |
88 | 95 | then throw("crowdfunding is reached to hard cap. thank you for participating!") | |
89 | - | else if (!( | |
96 | + | else if (!(q(r))) | |
90 | 97 | then throw("you have to attach payment greater than zero") | |
91 | 98 | else { | |
92 | - | let s = q.payments[0] | |
93 | - | let I = s.amount | |
94 | - | [IntegerEntry(((d + m) + toString(C)), (H + 1)), IntegerEntry(((d + n) + toString(C)), (F + I)), IntegerEntry(((((d + o) + E) + "_") + toString(C)), (G + I))] | |
99 | + | let x = valueOrElse(getBoolean(this, c), true) | |
100 | + | if (x) | |
101 | + | then throw("emergency shutdown") | |
102 | + | else { | |
103 | + | let t = r.payments[0] | |
104 | + | let L = t.amount | |
105 | + | [IntegerEntry(((e + n) + toString(F)), (K + 1)), IntegerEntry(((e + o) + toString(F)), (I + L)), IntegerEntry(((((e + p) + H) + "_") + toString(F)), (J + L))] | |
106 | + | } | |
95 | 107 | } | |
96 | 108 | } | |
97 | 109 | ||
98 | 110 | ||
99 | 111 | ||
100 | - | @Callable( | |
112 | + | @Callable(r) | |
101 | 113 | func claim () = throw("event owner will claim the money") | |
102 | 114 | ||
103 | 115 | ||
104 | 116 | ||
105 | - | @Callable( | |
117 | + | @Callable(r) | |
106 | 118 | func refund () = throw("if not success payers gonna refund") | |
107 | 119 | ||
108 | 120 | ||
109 | 121 | ||
110 | - | @Callable( | |
111 | - | func delete ( | |
112 | - | then [DeleteEntry( | |
122 | + | @Callable(r) | |
123 | + | func delete (M) = if ((r.callerPublicKey == a)) | |
124 | + | then [DeleteEntry(M)] | |
113 | 125 | else throw("you are not allowed to do this!") | |
114 | 126 | ||
115 | 127 | ||
116 | - | @Verifier( | |
117 | - | func | |
128 | + | @Verifier(N) | |
129 | + | func O () = sigVerify(N.bodyBytes, N.proofs[0], N.senderPublicKey) | |
118 | 130 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'E5xdZLn3yHKAn29pTyubhr9R1mkRGg9WKAcpPrCYFYHx' | |
5 | 5 | ||
6 | 6 | let b = base58'3Eh6z6z6ouFpWxGKrPaPnZwmDnDjgYHV6tqCmZf2G7tk' | |
7 | 7 | ||
8 | - | let c = "_ | |
8 | + | let c = "_shutDown_" | |
9 | 9 | ||
10 | - | let d = "_ | |
10 | + | let d = "_event_" | |
11 | 11 | ||
12 | - | let e = "_ | |
12 | + | let e = "_payment_" | |
13 | 13 | ||
14 | - | let f = "_ | |
14 | + | let f = "_eventId_" | |
15 | 15 | ||
16 | - | let g = "_ | |
16 | + | let g = "_startBlock_" | |
17 | 17 | ||
18 | - | let h = "_ | |
18 | + | let h = "_endBlock_" | |
19 | 19 | ||
20 | - | let i = "_ | |
20 | + | let i = "_image_" | |
21 | 21 | ||
22 | - | let j = "_ | |
22 | + | let j = "_owner_" | |
23 | 23 | ||
24 | - | let k = "_ | |
24 | + | let k = "_url_" | |
25 | 25 | ||
26 | - | let l = "_ | |
26 | + | let l = "_hardCap_" | |
27 | 27 | ||
28 | - | let m = "_ | |
28 | + | let m = "_title_" | |
29 | 29 | ||
30 | - | let n = "_ | |
30 | + | let n = "_shareHolderCount_" | |
31 | 31 | ||
32 | - | let o = "_ | |
32 | + | let o = "_totalPayment_" | |
33 | 33 | ||
34 | - | func p (q) = { | |
35 | - | let r = b | |
36 | - | if ((size(q.payments) == 0)) | |
34 | + | let p = "_walletPayment_" | |
35 | + | ||
36 | + | func q (r) = { | |
37 | + | let s = b | |
38 | + | if ((size(r.payments) == 0)) | |
37 | 39 | then throw("Payment not attached") | |
38 | 40 | else { | |
39 | - | let | |
40 | - | let | |
41 | - | if ($isInstanceOf( | |
41 | + | let t = r.payments[0] | |
42 | + | let u = t.assetId | |
43 | + | if ($isInstanceOf(u, "ByteVector")) | |
42 | 44 | then { | |
43 | - | let | |
44 | - | if (( | |
45 | - | then ( | |
45 | + | let v = u | |
46 | + | if ((v == s)) | |
47 | + | then (t.amount > 0) | |
46 | 48 | else false | |
47 | 49 | } | |
48 | 50 | else throw("Wrong payment asset") | |
49 | 51 | } | |
50 | 52 | } | |
51 | 53 | ||
52 | 54 | ||
53 | - | @Callable(q) | |
54 | - | func shutdown () = throw("shutdown") | |
55 | + | @Callable(r) | |
56 | + | func shutdown (w) = { | |
57 | + | let x = valueOrElse(getBoolean(this, c), true) | |
58 | + | if ((r.callerPublicKey == a)) | |
59 | + | then [BooleanEntry(c, x)] | |
60 | + | else throw("you are not allow to do this!") | |
61 | + | } | |
55 | 62 | ||
56 | 63 | ||
57 | 64 | ||
58 | - | @Callable( | |
65 | + | @Callable(r) | |
59 | 66 | func settings () = throw("settings") | |
60 | 67 | ||
61 | 68 | ||
62 | 69 | ||
63 | - | @Callable( | |
64 | - | func create ( | |
65 | - | let | |
66 | - | let | |
67 | - | if (( | |
68 | - | then [StringEntry((( | |
70 | + | @Callable(r) | |
71 | + | func create (y,z,A,B,C,D,E) = { | |
72 | + | let F = valueOrElse(getInteger(this, f), 0) | |
73 | + | let G = (F + 1) | |
74 | + | if ((r.callerPublicKey == a)) | |
75 | + | then [StringEntry(((d + i) + toString(G)), z), StringEntry(((d + j) + toString(G)), A), StringEntry(((d + m) + toString(G)), y), IntegerEntry(((d + g) + toString(G)), B), IntegerEntry(((d + h) + toString(G)), C), StringEntry(((d + k) + toString(G)), D), IntegerEntry(((d + l) + toString(G)), E), IntegerEntry((d + f), G)] | |
69 | 76 | else throw("you are not allowed") | |
70 | 77 | } | |
71 | 78 | ||
72 | 79 | ||
73 | 80 | ||
74 | - | @Callable( | |
75 | - | func funding ( | |
76 | - | let | |
77 | - | let | |
78 | - | let | |
79 | - | let | |
80 | - | let | |
81 | - | let | |
82 | - | let | |
83 | - | if (( | |
81 | + | @Callable(r) | |
82 | + | func funding (F) = { | |
83 | + | let B = valueOrErrorMessage(getInteger(this, ((d + g) + toString(F))), "err") | |
84 | + | let C = valueOrErrorMessage(getInteger(this, ((d + h) + toString(F))), "err") | |
85 | + | let E = valueOrErrorMessage(getInteger(this, ((d + l) + toString(F))), "err") | |
86 | + | let H = toBase58String(r.caller.bytes) | |
87 | + | let I = valueOrElse(getInteger(this, ((e + o) + toString(F))), 0) | |
88 | + | let J = valueOrElse(getInteger(this, (((e + p) + H) + toString(F))), 0) | |
89 | + | let K = valueOrElse(getInteger(this, ((e + n) + toString(F))), 0) | |
90 | + | if ((B > height)) | |
84 | 91 | then throw("crowdfunding not started") | |
85 | - | else if ((height >= | |
92 | + | else if ((height >= C)) | |
86 | 93 | then throw("crowdfunding is over") | |
87 | - | else if (( | |
94 | + | else if ((I >= E)) | |
88 | 95 | then throw("crowdfunding is reached to hard cap. thank you for participating!") | |
89 | - | else if (!( | |
96 | + | else if (!(q(r))) | |
90 | 97 | then throw("you have to attach payment greater than zero") | |
91 | 98 | else { | |
92 | - | let s = q.payments[0] | |
93 | - | let I = s.amount | |
94 | - | [IntegerEntry(((d + m) + toString(C)), (H + 1)), IntegerEntry(((d + n) + toString(C)), (F + I)), IntegerEntry(((((d + o) + E) + "_") + toString(C)), (G + I))] | |
99 | + | let x = valueOrElse(getBoolean(this, c), true) | |
100 | + | if (x) | |
101 | + | then throw("emergency shutdown") | |
102 | + | else { | |
103 | + | let t = r.payments[0] | |
104 | + | let L = t.amount | |
105 | + | [IntegerEntry(((e + n) + toString(F)), (K + 1)), IntegerEntry(((e + o) + toString(F)), (I + L)), IntegerEntry(((((e + p) + H) + "_") + toString(F)), (J + L))] | |
106 | + | } | |
95 | 107 | } | |
96 | 108 | } | |
97 | 109 | ||
98 | 110 | ||
99 | 111 | ||
100 | - | @Callable( | |
112 | + | @Callable(r) | |
101 | 113 | func claim () = throw("event owner will claim the money") | |
102 | 114 | ||
103 | 115 | ||
104 | 116 | ||
105 | - | @Callable( | |
117 | + | @Callable(r) | |
106 | 118 | func refund () = throw("if not success payers gonna refund") | |
107 | 119 | ||
108 | 120 | ||
109 | 121 | ||
110 | - | @Callable( | |
111 | - | func delete ( | |
112 | - | then [DeleteEntry( | |
122 | + | @Callable(r) | |
123 | + | func delete (M) = if ((r.callerPublicKey == a)) | |
124 | + | then [DeleteEntry(M)] | |
113 | 125 | else throw("you are not allowed to do this!") | |
114 | 126 | ||
115 | 127 | ||
116 | - | @Verifier( | |
117 | - | func | |
128 | + | @Verifier(N) | |
129 | + | func O () = sigVerify(N.bodyBytes, N.proofs[0], N.senderPublicKey) | |
118 | 130 |
github/deemru/w8io/026f985 47.72 ms ◑