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