tx · kGvUWxe2yKtbURaYe33xr3PLryapsWWpjuvCryTf6en 3N8bfBHf85mChgxdRoTj11XEHHREfQmz6dw: -0.01000000 Waves 2023.03.13 01:53 [2487438] smart account 3N8bfBHf85mChgxdRoTj11XEHHREfQmz6dw > SELF 0.00000000 Waves
{ "type": 13, "id": "kGvUWxe2yKtbURaYe33xr3PLryapsWWpjuvCryTf6en", "fee": 1000000, "feeAssetId": null, "timestamp": 1678661639854, "version": 2, "chainId": 84, "sender": "3N8bfBHf85mChgxdRoTj11XEHHREfQmz6dw", "senderPublicKey": "6G9zJtFnV938b3kA2t6HebP8i69A1NMGVQ5qQ78fF1FR", "proofs": [ "2nCaoaGJpF5RfLYNZtv2bnEwmwdU8SR34BJUkQ6muvft5mzfBDpGXVHCM77ZgeiNf3V2n7TcdbPwcgXgWKJZ244c" ], "script": "base64:AAIFAAAAAAAAACEIAhILCgkBAQEBCAgICAESABIAEgUKAwEICBIFCgMBAQEAAAAVAAAAAAJwcwIAAAANUFJFU0FMRV9TVEFSVAAAAAACcGQCAAAAEFBSRVNBTEVfRFVSQVRJT04AAAAAAmNzAgAAAAtDTEFJTV9TVEFSVAAAAAACY2QCAAAADkNMQUlNX0RVUkFUSU9OAAAAAAFwAgAAAAlQUklDRV9JRE8AAAAABHAxSUQCAAAAEFBSSUNFXzFfQVNTRVRfSUQAAAAACmFkbWluRXJyb3ICAAAALk9ubHkgdGhlIEFkbWluIGl0c2VsZiBjYW4gaW52b2tlIHRoaXMgZnVuY3Rpb24AAAAABHAySUQCAAAAEFBSSUNFXzJfQVNTRVRfSUQAAAAABHAzSUQCAAAAEFBSSUNFXzNfQVNTRVRfSUQAAAAABHA0SUQCAAAAEFBSSUNFXzRfQVNTRVRfSUQAAAAAA21pYQIAAAARTUlOX0FNT1VOVF9JTlZFU1QAAAAABW1haW5hAgAAAApNQUlOX0FTU0VUAAAAAAdmb3JTYWxlAgAAAA5UT1RBTF9GT1JfU0FMRQAAAAAJdG90YWxTYWxlAgAAAAp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5zZmVyAAAAAwkBAAAAB0FkZHJlc3MAAAABCQACWQAAAAEFAAAAB2FkZHJlc3MFAAAABVZhbHVlCQACWQAAAAEFAAAAB2Fzc2V0SWQFAAAAA25pbAkAAAIAAAABBQAAAAphZG1pbkVycm9yAAAAAWkBAAAABHRpbWUAAAADAAAADHByZXNhbGVTdGFydAAAAA9wcmVzYWxlRHVyYXRpb24AAAAUZGlzdHJpYnV0aW9uRHVyYXRpb24DAwkAAAAAAAACCAUAAAABaQAAAAZjYWxsZXIFAAAABHRoaXMGCQAAAAAAAAIICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMJAQAAABFAZXh0ck5hdGl2ZSgxMDUyKQAAAAIFAAAABHRoaXMCAAAABWFkbWluAwkAAGcAAAACBQAAAA9wcmVzYWxlRHVyYXRpb24FAAAADHByZXNhbGVTdGFydAkAAAIAAAABAgAAADJQcmVzYWxlRHVyYXRpb24gY2FuJ3QgYmUgYmlnZ2VyIHRoYW4gIFByZXNhbGVTdGFydAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAACcHMFAAAADHByZXNhbGVTdGFydAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAACcGQFAAAAD3ByZXNhbGVEdXJhdGlvbgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAFZGlzZHUFAAAAFGRpc3RyaWJ1dGlvbkR1cmF0aW9uBQAAAANuaWwJAAACAAAAAQUAAAAKYWRtaW5FcnJvcgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5gi4MDQ==", "height": 2487438, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2zAEnCMo4o9pQEm57rHWbZwV4pM2mF7PnUxD1L1hx8hS Next: 3Ck2G8Mytn8CGR7KDCHGdR1Yeto8RB9ZA8cATjRFvtJ2 Diff:
Old | New | Differences | |
---|---|---|---|
40 | 40 | func s (t) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(t))).id, (("Asset Id: " + t) + " is invalid."))) | |
41 | 41 | ||
42 | 42 | ||
43 | - | @Callable(u) | |
44 | - | func AddAdmin (v) = if ((u.caller.bytes == this.bytes)) | |
45 | - | then [StringEntry("admin", v)] | |
46 | - | else throw(g) | |
43 | + | let u = "3PLVPoB6KsXCtqowhzWJStijNw7SjsPKsq6" | |
47 | 44 | ||
45 | + | let v = Address(fromBase58String(u)) | |
48 | 46 | ||
49 | - | ||
50 | - | @Callable(u) | |
51 | - | func constructor (w,x,y,z,A,B,C,D,E) = { | |
52 | - | let F = s(A) | |
47 | + | @Callable(w) | |
48 | + | func constructor (x,y,z,A,B,C,D,E,F) = { | |
53 | 49 | let G = s(B) | |
54 | 50 | let H = s(C) | |
55 | - | if (if ((u.caller == this)) | |
51 | + | let I = s(D) | |
52 | + | if (if ((w.caller == this)) | |
56 | 53 | then true | |
57 | - | else ( | |
58 | - | then if (( | |
54 | + | else (w.caller.bytes == getBinaryValue(v, "admin"))) | |
55 | + | then if ((y >= x)) | |
59 | 56 | then throw("PresaleDuration can't be bigger than PresaleStart") | |
60 | - | else if (( | |
57 | + | else if ((F > A)) | |
61 | 58 | then throw("minInvestAmount can't be bigger than price") | |
62 | - | else if (if (if (( | |
59 | + | else if (if (if ((G == H)) | |
63 | 60 | then true | |
64 | - | else ( | |
61 | + | else (G == I)) | |
65 | 62 | then true | |
66 | - | else ( | |
63 | + | else (H == I)) | |
67 | 64 | then throw("Each Asset must be different from the other.") | |
68 | - | else [StringEntry(f, | |
65 | + | else [StringEntry(f, B), StringEntry(h, C), StringEntry(i, D), StringEntry(j, E), IntegerEntry(a, x), IntegerEntry(b, y), IntegerEntry(e, A), IntegerEntry(k, F), IntegerEntry(n, 0), IntegerEntry(p, z)] | |
69 | 66 | else throw(g) | |
70 | 67 | } | |
71 | 68 | ||
72 | 69 | ||
73 | 70 | ||
74 | - | @Callable( | |
75 | - | func set () = if (if (( | |
71 | + | @Callable(w) | |
72 | + | func set () = if (if ((w.caller == this)) | |
76 | 73 | then true | |
77 | - | else ( | |
78 | - | then if ((size( | |
74 | + | else (w.caller.bytes == getBinaryValue(v, "admin"))) | |
75 | + | then if ((size(w.payments) != 1)) | |
79 | 76 | then throw("exactly 1 payment must be attached") | |
80 | - | else [IntegerEntry(m, value( | |
77 | + | else [IntegerEntry(m, value(w.payments[0]).amount), BinaryEntry(l, value(w.payments[0].assetId))] | |
81 | 78 | else throw(g) | |
82 | 79 | ||
83 | 80 | ||
84 | 81 | ||
85 | - | @Callable( | |
82 | + | @Callable(w) | |
86 | 83 | func invest () = { | |
87 | - | let | |
88 | - | let | |
89 | - | let | |
90 | - | let | |
91 | - | let | |
92 | - | let | |
93 | - | let | |
94 | - | let | |
95 | - | let | |
96 | - | let | |
97 | - | let | |
98 | - | let | |
99 | - | let | |
100 | - | let | |
101 | - | let | |
102 | - | let | |
103 | - | if (( | |
84 | + | let J = getBinaryValue(this, l) | |
85 | + | let x = getIntegerValue(this, a) | |
86 | + | let y = getIntegerValue(this, b) | |
87 | + | let K = (x + y) | |
88 | + | let A = getIntegerValue(this, e) | |
89 | + | let L = height | |
90 | + | let M = value(w.payments[0]) | |
91 | + | let N = toBase58String(value(M.assetId)) | |
92 | + | let O = M.amount | |
93 | + | let G = getStringValue(this, f) | |
94 | + | let H = getStringValue(this, h) | |
95 | + | let I = getStringValue(this, i) | |
96 | + | let P = getStringValue(this, j) | |
97 | + | let Q = getIntegerValue(this, n) | |
98 | + | let R = getIntegerValue(this, m) | |
99 | + | let S = getIntegerValue(this, k) | |
100 | + | if ((x >= L)) | |
104 | 101 | then throw("presale has not been started yet") | |
105 | - | else if (( | |
102 | + | else if ((L >= K)) | |
106 | 103 | then throw("presale has been already ended") | |
107 | - | else if ((size( | |
104 | + | else if ((size(w.payments) != 1)) | |
108 | 105 | then throw("exactly 1 payment is expected") | |
109 | - | else if (if (if (if (( | |
110 | - | then ( | |
106 | + | else if (if (if (if ((N != G)) | |
107 | + | then (N != H) | |
111 | 108 | else false) | |
112 | - | then ( | |
109 | + | then (N != I) | |
113 | 110 | else false) | |
114 | - | then ( | |
111 | + | then (N != P) | |
115 | 112 | else false) | |
116 | - | then throw(((("invalid payment asset id:" + | |
117 | - | else if (( | |
113 | + | then throw(((("invalid payment asset id:" + N) + " Expected:") + G)) | |
114 | + | else if ((Q >= R)) | |
118 | 115 | then throw("Pre-sale asset has been - sold consider to use smaller payment") | |
119 | - | else if (( | |
116 | + | else if ((S > O)) | |
120 | 117 | then throw("Amount less than the minimum to be invested.") | |
121 | 118 | else { | |
122 | - | let | |
123 | - | let | |
124 | - | let | |
125 | - | if ($isInstanceOf( | |
119 | + | let T = ((O / A) * q) | |
120 | + | let U = { | |
121 | + | let V = getInteger(this, (o + toBase58String(w.caller.bytes))) | |
122 | + | if ($isInstanceOf(V, "Int")) | |
126 | 123 | then { | |
127 | - | let | |
128 | - | | |
124 | + | let W = V | |
125 | + | W | |
129 | 126 | } | |
130 | 127 | else 0 | |
131 | 128 | } | |
132 | - | [ScriptTransfer( | |
129 | + | [ScriptTransfer(w.caller, T, J), IntegerEntry(n, (Q + T)), IntegerEntry((o + toBase58String(w.caller.bytes)), (T + U)), IntegerEntry(((((o + toBase58String(w.caller.bytes)) + "__") + N) + "__VALUE"), O), BooleanEntry((((o + toBase58String(w.caller.bytes)) + "__") + N), true)] | |
133 | 130 | } | |
134 | 131 | } | |
135 | 132 | ||
136 | 133 | ||
137 | 134 | ||
138 | - | @Callable( | |
139 | - | func adminV ( | |
135 | + | @Callable(w) | |
136 | + | func adminV (X,Y,t) = if (if ((w.caller == this)) | |
140 | 137 | then true | |
141 | - | else ( | |
142 | - | then [ScriptTransfer(Address(fromBase58String( | |
138 | + | else (w.caller == Address(getBinaryValue(this, "admin")))) | |
139 | + | then [ScriptTransfer(Address(fromBase58String(Y)), X, fromBase58String(t))] | |
143 | 140 | else throw(g) | |
144 | 141 | ||
145 | 142 | ||
146 | 143 | ||
147 | - | @Callable( | |
148 | - | func time ( | |
144 | + | @Callable(w) | |
145 | + | func time (x,y,z) = if (if ((w.caller == this)) | |
149 | 146 | then true | |
150 | - | else ( | |
151 | - | then if (( | |
147 | + | else (w.caller.bytes == getBinaryValue(this, "admin"))) | |
148 | + | then if ((y >= x)) | |
152 | 149 | then throw("PresaleDuration can't be bigger than PresaleStart") | |
153 | - | else [IntegerEntry(a, | |
150 | + | else [IntegerEntry(a, x), IntegerEntry(b, y), IntegerEntry(p, z)] | |
154 | 151 | else throw(g) | |
155 | 152 | ||
156 | 153 | ||
157 | - | @Verifier( | |
158 | - | func | |
154 | + | @Verifier(Z) | |
155 | + | func aa () = sigVerify(Z.bodyBytes, Z.proofs[0], Z.senderPublicKey) | |
159 | 156 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "PRESALE_START" | |
5 | 5 | ||
6 | 6 | let b = "PRESALE_DURATION" | |
7 | 7 | ||
8 | 8 | let c = "CLAIM_START" | |
9 | 9 | ||
10 | 10 | let d = "CLAIM_DURATION" | |
11 | 11 | ||
12 | 12 | let e = "PRICE_IDO" | |
13 | 13 | ||
14 | 14 | let f = "PRICE_1_ASSET_ID" | |
15 | 15 | ||
16 | 16 | let g = "Only the Admin itself can invoke this function" | |
17 | 17 | ||
18 | 18 | let h = "PRICE_2_ASSET_ID" | |
19 | 19 | ||
20 | 20 | let i = "PRICE_3_ASSET_ID" | |
21 | 21 | ||
22 | 22 | let j = "PRICE_4_ASSET_ID" | |
23 | 23 | ||
24 | 24 | let k = "MIN_AMOUNT_INVEST" | |
25 | 25 | ||
26 | 26 | let l = "MAIN_ASSET" | |
27 | 27 | ||
28 | 28 | let m = "TOTAL_FOR_SALE" | |
29 | 29 | ||
30 | 30 | let n = "TOTAL_SALE" | |
31 | 31 | ||
32 | 32 | let o = "TOTAL_INVEST_" | |
33 | 33 | ||
34 | 34 | let p = "DISTRIBUTION_DURATION" | |
35 | 35 | ||
36 | 36 | let q = 100000000 | |
37 | 37 | ||
38 | 38 | let r = 10000000000 | |
39 | 39 | ||
40 | 40 | func s (t) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(t))).id, (("Asset Id: " + t) + " is invalid."))) | |
41 | 41 | ||
42 | 42 | ||
43 | - | @Callable(u) | |
44 | - | func AddAdmin (v) = if ((u.caller.bytes == this.bytes)) | |
45 | - | then [StringEntry("admin", v)] | |
46 | - | else throw(g) | |
43 | + | let u = "3PLVPoB6KsXCtqowhzWJStijNw7SjsPKsq6" | |
47 | 44 | ||
45 | + | let v = Address(fromBase58String(u)) | |
48 | 46 | ||
49 | - | ||
50 | - | @Callable(u) | |
51 | - | func constructor (w,x,y,z,A,B,C,D,E) = { | |
52 | - | let F = s(A) | |
47 | + | @Callable(w) | |
48 | + | func constructor (x,y,z,A,B,C,D,E,F) = { | |
53 | 49 | let G = s(B) | |
54 | 50 | let H = s(C) | |
55 | - | if (if ((u.caller == this)) | |
51 | + | let I = s(D) | |
52 | + | if (if ((w.caller == this)) | |
56 | 53 | then true | |
57 | - | else ( | |
58 | - | then if (( | |
54 | + | else (w.caller.bytes == getBinaryValue(v, "admin"))) | |
55 | + | then if ((y >= x)) | |
59 | 56 | then throw("PresaleDuration can't be bigger than PresaleStart") | |
60 | - | else if (( | |
57 | + | else if ((F > A)) | |
61 | 58 | then throw("minInvestAmount can't be bigger than price") | |
62 | - | else if (if (if (( | |
59 | + | else if (if (if ((G == H)) | |
63 | 60 | then true | |
64 | - | else ( | |
61 | + | else (G == I)) | |
65 | 62 | then true | |
66 | - | else ( | |
63 | + | else (H == I)) | |
67 | 64 | then throw("Each Asset must be different from the other.") | |
68 | - | else [StringEntry(f, | |
65 | + | else [StringEntry(f, B), StringEntry(h, C), StringEntry(i, D), StringEntry(j, E), IntegerEntry(a, x), IntegerEntry(b, y), IntegerEntry(e, A), IntegerEntry(k, F), IntegerEntry(n, 0), IntegerEntry(p, z)] | |
69 | 66 | else throw(g) | |
70 | 67 | } | |
71 | 68 | ||
72 | 69 | ||
73 | 70 | ||
74 | - | @Callable( | |
75 | - | func set () = if (if (( | |
71 | + | @Callable(w) | |
72 | + | func set () = if (if ((w.caller == this)) | |
76 | 73 | then true | |
77 | - | else ( | |
78 | - | then if ((size( | |
74 | + | else (w.caller.bytes == getBinaryValue(v, "admin"))) | |
75 | + | then if ((size(w.payments) != 1)) | |
79 | 76 | then throw("exactly 1 payment must be attached") | |
80 | - | else [IntegerEntry(m, value( | |
77 | + | else [IntegerEntry(m, value(w.payments[0]).amount), BinaryEntry(l, value(w.payments[0].assetId))] | |
81 | 78 | else throw(g) | |
82 | 79 | ||
83 | 80 | ||
84 | 81 | ||
85 | - | @Callable( | |
82 | + | @Callable(w) | |
86 | 83 | func invest () = { | |
87 | - | let | |
88 | - | let | |
89 | - | let | |
90 | - | let | |
91 | - | let | |
92 | - | let | |
93 | - | let | |
94 | - | let | |
95 | - | let | |
96 | - | let | |
97 | - | let | |
98 | - | let | |
99 | - | let | |
100 | - | let | |
101 | - | let | |
102 | - | let | |
103 | - | if (( | |
84 | + | let J = getBinaryValue(this, l) | |
85 | + | let x = getIntegerValue(this, a) | |
86 | + | let y = getIntegerValue(this, b) | |
87 | + | let K = (x + y) | |
88 | + | let A = getIntegerValue(this, e) | |
89 | + | let L = height | |
90 | + | let M = value(w.payments[0]) | |
91 | + | let N = toBase58String(value(M.assetId)) | |
92 | + | let O = M.amount | |
93 | + | let G = getStringValue(this, f) | |
94 | + | let H = getStringValue(this, h) | |
95 | + | let I = getStringValue(this, i) | |
96 | + | let P = getStringValue(this, j) | |
97 | + | let Q = getIntegerValue(this, n) | |
98 | + | let R = getIntegerValue(this, m) | |
99 | + | let S = getIntegerValue(this, k) | |
100 | + | if ((x >= L)) | |
104 | 101 | then throw("presale has not been started yet") | |
105 | - | else if (( | |
102 | + | else if ((L >= K)) | |
106 | 103 | then throw("presale has been already ended") | |
107 | - | else if ((size( | |
104 | + | else if ((size(w.payments) != 1)) | |
108 | 105 | then throw("exactly 1 payment is expected") | |
109 | - | else if (if (if (if (( | |
110 | - | then ( | |
106 | + | else if (if (if (if ((N != G)) | |
107 | + | then (N != H) | |
111 | 108 | else false) | |
112 | - | then ( | |
109 | + | then (N != I) | |
113 | 110 | else false) | |
114 | - | then ( | |
111 | + | then (N != P) | |
115 | 112 | else false) | |
116 | - | then throw(((("invalid payment asset id:" + | |
117 | - | else if (( | |
113 | + | then throw(((("invalid payment asset id:" + N) + " Expected:") + G)) | |
114 | + | else if ((Q >= R)) | |
118 | 115 | then throw("Pre-sale asset has been - sold consider to use smaller payment") | |
119 | - | else if (( | |
116 | + | else if ((S > O)) | |
120 | 117 | then throw("Amount less than the minimum to be invested.") | |
121 | 118 | else { | |
122 | - | let | |
123 | - | let | |
124 | - | let | |
125 | - | if ($isInstanceOf( | |
119 | + | let T = ((O / A) * q) | |
120 | + | let U = { | |
121 | + | let V = getInteger(this, (o + toBase58String(w.caller.bytes))) | |
122 | + | if ($isInstanceOf(V, "Int")) | |
126 | 123 | then { | |
127 | - | let | |
128 | - | | |
124 | + | let W = V | |
125 | + | W | |
129 | 126 | } | |
130 | 127 | else 0 | |
131 | 128 | } | |
132 | - | [ScriptTransfer( | |
129 | + | [ScriptTransfer(w.caller, T, J), IntegerEntry(n, (Q + T)), IntegerEntry((o + toBase58String(w.caller.bytes)), (T + U)), IntegerEntry(((((o + toBase58String(w.caller.bytes)) + "__") + N) + "__VALUE"), O), BooleanEntry((((o + toBase58String(w.caller.bytes)) + "__") + N), true)] | |
133 | 130 | } | |
134 | 131 | } | |
135 | 132 | ||
136 | 133 | ||
137 | 134 | ||
138 | - | @Callable( | |
139 | - | func adminV ( | |
135 | + | @Callable(w) | |
136 | + | func adminV (X,Y,t) = if (if ((w.caller == this)) | |
140 | 137 | then true | |
141 | - | else ( | |
142 | - | then [ScriptTransfer(Address(fromBase58String( | |
138 | + | else (w.caller == Address(getBinaryValue(this, "admin")))) | |
139 | + | then [ScriptTransfer(Address(fromBase58String(Y)), X, fromBase58String(t))] | |
143 | 140 | else throw(g) | |
144 | 141 | ||
145 | 142 | ||
146 | 143 | ||
147 | - | @Callable( | |
148 | - | func time ( | |
144 | + | @Callable(w) | |
145 | + | func time (x,y,z) = if (if ((w.caller == this)) | |
149 | 146 | then true | |
150 | - | else ( | |
151 | - | then if (( | |
147 | + | else (w.caller.bytes == getBinaryValue(this, "admin"))) | |
148 | + | then if ((y >= x)) | |
152 | 149 | then throw("PresaleDuration can't be bigger than PresaleStart") | |
153 | - | else [IntegerEntry(a, | |
150 | + | else [IntegerEntry(a, x), IntegerEntry(b, y), IntegerEntry(p, z)] | |
154 | 151 | else throw(g) | |
155 | 152 | ||
156 | 153 | ||
157 | - | @Verifier( | |
158 | - | func | |
154 | + | @Verifier(Z) | |
155 | + | func aa () = sigVerify(Z.bodyBytes, Z.proofs[0], Z.senderPublicKey) | |
159 | 156 |
github/deemru/w8io/169f3d6 61.30 ms ◑