tx · 92FsFgCi6vH5Z4FYgsCMFsvx9oV53K6etmeWdYjhZN7U

3MvMpGD5MxbUW2EJn6jtViDu6NHNqu8PKq8:  -0.01100000 Waves

2022.08.26 04:40 [2200796] smart account 3MvMpGD5MxbUW2EJn6jtViDu6NHNqu8PKq8 > SELF 0.00000000 Waves

{ "type": 13, "id": "92FsFgCi6vH5Z4FYgsCMFsvx9oV53K6etmeWdYjhZN7U", "fee": 1100000, "feeAssetId": null, "timestamp": 1661478037629, "version": 2, "chainId": 84, "sender": "3MvMpGD5MxbUW2EJn6jtViDu6NHNqu8PKq8", "senderPublicKey": "2MhVDhjG7eJ6SY8og2HRd4Bam75FsCSg2Vude8gutmZe", "proofs": [ "4PvCxSJJ49bTNuekiWmBD3L7Gxg8zryeRpeVeugn1n9FQxQvW6myMxi6eUQQrYd5uagjqy9uHgojEizrNhhXsWST" ], "script": "base64:AAIFAAAAAAAAAB4IAhIDCgEIEgoKCAEBAQEICAgBEgASABIFCgMBCAgAAAAQAAAAAAJwcwIAAAANUFJFU0FMRV9TVEFSVAAAAAACcGQCAAAAEFBSRVNBTEVfRFVSQVRJT04AAAAAAmNzAgAAAAtDTEFJTV9TVEFSVAAAAAACY2QCAAAADkNMQUlNX0RVUkFUSU9OAAAAAAFwAgAAAAlQUklDRV9JRE8AAAAABHAxSUQCAAAAEFBSSUNFXzFfQVNTRVRfSUQAAAAABHAySUQCAAAAEFBSSUNFXzJfQVNTRVRfSUQAAAAABHAzSUQCAAAAEFBSSUNFXzNfQVNTRVRfSUQAAAAAA21pYQIAAAARTUlOX0FNT1VOVF9JTlZFU1QAAAAABW1haW5hAgAAAApNQUlOX0FTU0VUAAAAAAdmb3JTYWxlAgAAAA5UT1RBTF9GT1JfU0FMRQAAAAAJdG90YWxTYWxlAgAAAApUT1RBTF9TQUxFAAAAAAd0aW52ZXN0AgAAAA1UT1RBTF9JTlZFU1RfAAAAAAVkaXNkdQIAAAAVRElTVFJJQlVUSU9OX0RVUkFUSU9OAAAAA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UyKQAAAAIFAAAABHRoaXMCAAAABWFkbWluCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAAAdBZGRyZXNzAAAAAQkAAlkAAAABBQAAAAdhZGRyZXNzBQAAAAVWYWx1ZQkAAlkAAAABBQAAAAdhc3NldElkBQAAAANuaWwJAAACAAAAAQIAAAAuT25seSB0aGUgQWRtaW4gaXRzZWxmIGNhbiBpbnZva2UgdGhpcyBmdW5jdGlvbgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5T/eVyg==", "height": 2200796, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: WK7g5BecQbCG5zyV4zfZMjhRpbVv46QzQ8mAudy3gRA Next: 7DSGgVGHP2fkHW1NZrpYQYYQdpHoWmbRDFPxqnp6j2W3 Diff:
OldNewDifferences
2929
3030 let n = "DISTRIBUTION_DURATION"
3131
32-func o (p) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(p))).id, (("Asset Id: " + p) + " is invalid.")))
32+let o = 100000000
33+
34+func p (q) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(q))).id, (("Asset Id: " + q) + " is invalid.")))
3335
3436
35-@Callable(q)
36-func addAdmin (r) = if ((q.caller == this))
37- then [BinaryEntry("admin", fromBase58String(r))]
37+@Callable(r)
38+func addAdmin (s) = if ((r.caller == this))
39+ then [BinaryEntry("admin", fromBase58String(s))]
3840 else throw("Only the Admin itself can invoke this function")
3941
4042
4143
42-@Callable(q)
43-func constructor (s,t,u,v,w,x,y,z) = {
44- let A = o(w)
45- let B = o(x)
46- let C = o(y)
47- if (if ((q.caller == this))
44+@Callable(r)
45+func constructor (t,u,v,w,x,y,z,A) = {
46+ let B = p(x)
47+ let C = p(y)
48+ let D = p(z)
49+ if (if ((r.caller == this))
4850 then true
49- else (q.caller == Address(getBinaryValue(this, "admin"))))
50- then if ((t >= s))
51+ else (r.caller == Address(getBinaryValue(this, "admin"))))
52+ then if ((u >= t))
5153 then throw("PresaleDuration can't be bigger than PresaleStart")
52- else if ((z > v))
54+ else if ((A > w))
5355 then throw("minInvestAmount can't be bigger than price")
54- else if (if (if ((A == B))
56+ else if (if (if ((B == C))
5557 then true
56- else (A == C))
58+ else (B == D))
5759 then true
58- else (B == C))
60+ else (C == D))
5961 then throw("Each Asset must be different from the other.")
60- else if ((size(q.payments) != 1))
62+ else if ((size(r.payments) != 1))
6163 then throw("exactly 1 payment must be attached")
62- else [BinaryEntry(j, value(q.payments[0].assetId)), StringEntry(f, w), StringEntry(g, x), StringEntry(h, y), IntegerEntry(a, s), IntegerEntry(b, t), IntegerEntry(e, v), IntegerEntry(i, z), IntegerEntry(k, value(q.payments[0]).amount), IntegerEntry(l, 0), IntegerEntry(n, u)]
64+ else [BinaryEntry(j, value(r.payments[0].assetId)), StringEntry(f, x), StringEntry(g, y), StringEntry(h, z), IntegerEntry(a, t), IntegerEntry(b, u), IntegerEntry(e, w), IntegerEntry(i, A), IntegerEntry(k, value(r.payments[0]).amount), IntegerEntry(l, 0), IntegerEntry(n, v)]
6365 else throw("Only the Admin itself can invoke this function")
6466 }
6567
6668
6769
68-@Callable(q)
70+@Callable(r)
6971 func invest () = {
70- let D = getBinaryValue(this, j)
71- let s = getIntegerValue(this, a)
72- let t = getIntegerValue(this, b)
73- let E = (s + t)
74- let v = getIntegerValue(this, e)
75- let F = height
76- let G = value(q.payments[0])
77- let H = toBase58String(value(G.assetId))
78- let I = G.amount
79- let A = getStringValue(this, f)
80- let B = getStringValue(this, g)
81- let C = getStringValue(this, h)
82- let J = getIntegerValue(this, l)
83- let K = getIntegerValue(this, k)
84- let L = getIntegerValue(this, i)
85- if ((s >= F))
72+ let E = getBinaryValue(this, j)
73+ let t = getIntegerValue(this, a)
74+ let u = getIntegerValue(this, b)
75+ let F = (t + u)
76+ let w = getIntegerValue(this, e)
77+ let G = height
78+ let H = value(r.payments[0])
79+ let I = toBase58String(value(H.assetId))
80+ let J = H.amount
81+ let B = getStringValue(this, f)
82+ let C = getStringValue(this, g)
83+ let D = getStringValue(this, h)
84+ let K = getIntegerValue(this, l)
85+ let L = getIntegerValue(this, k)
86+ let M = getIntegerValue(this, i)
87+ if ((t >= G))
8688 then throw("presale has not been started yet")
87- else if ((F >= E))
89+ else if ((G >= F))
8890 then throw("presale has been already ended")
89- else if ((size(q.payments) != 1))
91+ else if ((size(r.payments) != 1))
9092 then throw("exactly 1 payment is expected")
91- else if (if (if ((H != A))
92- then (H != B)
93+ else if (if (if ((I != B))
94+ then (I != C)
9395 else false)
94- then (H != C)
96+ then (I != D)
9597 else false)
96- then throw(((("invalid payment asset id:" + H) + " Expected:") + A))
97- else if ((J >= K))
98+ then throw(((("invalid payment asset id:" + I) + " Expected:") + B))
99+ else if ((K >= L))
98100 then throw("Pre-sale asset has been - sold consider to use smaller payment")
99- else if ((L > I))
101+ else if ((M > J))
100102 then throw("Amount less than the minimum to be invested.")
101103 else {
102- let M = ((I / v) * 100000000)
103-[IntegerEntry(l, (J + M)), BooleanEntry((((m + toBase58String(q.caller.bytes)) + "__") + H), true)]
104+ let N = ((J / w) * o)
105+[IntegerEntry(l, (K + N)), BooleanEntry((((m + toBase58String(r.caller.bytes)) + "__") + I), true)]
104106 }
105107 }
106108
107109
108110
109-@Callable(q)
111+@Callable(r)
110112 func claimPresale () = {
111- let N = (getIntegerValue(this, b) + getIntegerValue(this, a))
112- let u = getIntegerValue(this, n)
113- let O = (N + u)
114- let D = getBinaryValue(this, j)
115- let F = height
116- let v = getIntegerValue(this, e)
117- if ((N >= F))
113+ let O = (getIntegerValue(this, b) + getIntegerValue(this, a))
114+ let v = getIntegerValue(this, n)
115+ let P = (O + v)
116+ let E = getBinaryValue(this, j)
117+ let G = height
118+ let w = getIntegerValue(this, e)
119+ if ((O >= G))
118120 then throw("The Presale is still happening.")
119121 else {
120- let P = if ((F > O))
121- then 100
122- else (F / O)
123- let Q = valueOrErrorMessage(getIntegerValue(this, (m + toBase58String(q.caller.bytes))), "You were not part of the presale")
124- let M = ((Q * P) / 100)
125- let R = (Q - M)
126- if ((valueOrElse(getIntegerValue(this, ("OLD_TOTAL_" + toBase58String(q.caller.bytes))), 0) == 0))
127- then [IntegerEntry((m + toBase58String(q.caller.bytes)), R), ScriptTransfer(q.caller, M, D), IntegerEntry(("OLD_TOTAL_" + toBase58String(q.caller.bytes)), Q)]
128- else [IntegerEntry((m + toBase58String(q.caller.bytes)), R), ScriptTransfer(q.caller, M, D)]
122+ let Q = if ((G > P))
123+ then toBigInt(100)
124+ else ((toBigInt(G) * toBigInt(o)) / (toBigInt(P) * toBigInt(o)))
125+ let R = valueOrErrorMessage(getIntegerValue(this, (m + toBase58String(r.caller.bytes))), "You were not part of the presale")
126+ let N = ((toBigInt(R) * (Q * toBigInt(o))) / toBigInt(100))
127+ let S = (toBigInt(R) - N)
128+ if ((valueOrElse(getIntegerValue(this, ("OLD_TOTAL_" + toBase58String(r.caller.bytes))), 0) == 0))
129+ then [IntegerEntry((m + toBase58String(r.caller.bytes)), toInt(S)), ScriptTransfer(r.caller, toInt(N), E), IntegerEntry(("OLD_TOTAL_" + toBase58String(r.caller.bytes)), R)]
130+ else [IntegerEntry((m + toBase58String(r.caller.bytes)), toInt(S)), ScriptTransfer(r.caller, toInt(N), E)]
129131 }
130132 }
131133
132134
133135
134-@Callable(q)
135-func adminV (S,r,p) = if (if ((q.caller == this))
136+@Callable(r)
137+func adminV (T,s,q) = if (if ((r.caller == this))
136138 then true
137- else (q.caller == Address(getBinaryValue(this, "admin"))))
138- then [ScriptTransfer(Address(fromBase58String(r)), S, fromBase58String(p))]
139+ else (r.caller == Address(getBinaryValue(this, "admin"))))
140+ then [ScriptTransfer(Address(fromBase58String(s)), T, fromBase58String(q))]
139141 else throw("Only the Admin itself can invoke this function")
140142
141143
142-@Verifier(T)
143-func U () = sigVerify(T.bodyBytes, T.proofs[0], T.senderPublicKey)
144+@Verifier(U)
145+func V () = sigVerify(U.bodyBytes, U.proofs[0], U.senderPublicKey)
144146
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "PRESALE_START"
55
66 let b = "PRESALE_DURATION"
77
88 let c = "CLAIM_START"
99
1010 let d = "CLAIM_DURATION"
1111
1212 let e = "PRICE_IDO"
1313
1414 let f = "PRICE_1_ASSET_ID"
1515
1616 let g = "PRICE_2_ASSET_ID"
1717
1818 let h = "PRICE_3_ASSET_ID"
1919
2020 let i = "MIN_AMOUNT_INVEST"
2121
2222 let j = "MAIN_ASSET"
2323
2424 let k = "TOTAL_FOR_SALE"
2525
2626 let l = "TOTAL_SALE"
2727
2828 let m = "TOTAL_INVEST_"
2929
3030 let n = "DISTRIBUTION_DURATION"
3131
32-func o (p) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(p))).id, (("Asset Id: " + p) + " is invalid.")))
32+let o = 100000000
33+
34+func p (q) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(q))).id, (("Asset Id: " + q) + " is invalid.")))
3335
3436
35-@Callable(q)
36-func addAdmin (r) = if ((q.caller == this))
37- then [BinaryEntry("admin", fromBase58String(r))]
37+@Callable(r)
38+func addAdmin (s) = if ((r.caller == this))
39+ then [BinaryEntry("admin", fromBase58String(s))]
3840 else throw("Only the Admin itself can invoke this function")
3941
4042
4143
42-@Callable(q)
43-func constructor (s,t,u,v,w,x,y,z) = {
44- let A = o(w)
45- let B = o(x)
46- let C = o(y)
47- if (if ((q.caller == this))
44+@Callable(r)
45+func constructor (t,u,v,w,x,y,z,A) = {
46+ let B = p(x)
47+ let C = p(y)
48+ let D = p(z)
49+ if (if ((r.caller == this))
4850 then true
49- else (q.caller == Address(getBinaryValue(this, "admin"))))
50- then if ((t >= s))
51+ else (r.caller == Address(getBinaryValue(this, "admin"))))
52+ then if ((u >= t))
5153 then throw("PresaleDuration can't be bigger than PresaleStart")
52- else if ((z > v))
54+ else if ((A > w))
5355 then throw("minInvestAmount can't be bigger than price")
54- else if (if (if ((A == B))
56+ else if (if (if ((B == C))
5557 then true
56- else (A == C))
58+ else (B == D))
5759 then true
58- else (B == C))
60+ else (C == D))
5961 then throw("Each Asset must be different from the other.")
60- else if ((size(q.payments) != 1))
62+ else if ((size(r.payments) != 1))
6163 then throw("exactly 1 payment must be attached")
62- else [BinaryEntry(j, value(q.payments[0].assetId)), StringEntry(f, w), StringEntry(g, x), StringEntry(h, y), IntegerEntry(a, s), IntegerEntry(b, t), IntegerEntry(e, v), IntegerEntry(i, z), IntegerEntry(k, value(q.payments[0]).amount), IntegerEntry(l, 0), IntegerEntry(n, u)]
64+ else [BinaryEntry(j, value(r.payments[0].assetId)), StringEntry(f, x), StringEntry(g, y), StringEntry(h, z), IntegerEntry(a, t), IntegerEntry(b, u), IntegerEntry(e, w), IntegerEntry(i, A), IntegerEntry(k, value(r.payments[0]).amount), IntegerEntry(l, 0), IntegerEntry(n, v)]
6365 else throw("Only the Admin itself can invoke this function")
6466 }
6567
6668
6769
68-@Callable(q)
70+@Callable(r)
6971 func invest () = {
70- let D = getBinaryValue(this, j)
71- let s = getIntegerValue(this, a)
72- let t = getIntegerValue(this, b)
73- let E = (s + t)
74- let v = getIntegerValue(this, e)
75- let F = height
76- let G = value(q.payments[0])
77- let H = toBase58String(value(G.assetId))
78- let I = G.amount
79- let A = getStringValue(this, f)
80- let B = getStringValue(this, g)
81- let C = getStringValue(this, h)
82- let J = getIntegerValue(this, l)
83- let K = getIntegerValue(this, k)
84- let L = getIntegerValue(this, i)
85- if ((s >= F))
72+ let E = getBinaryValue(this, j)
73+ let t = getIntegerValue(this, a)
74+ let u = getIntegerValue(this, b)
75+ let F = (t + u)
76+ let w = getIntegerValue(this, e)
77+ let G = height
78+ let H = value(r.payments[0])
79+ let I = toBase58String(value(H.assetId))
80+ let J = H.amount
81+ let B = getStringValue(this, f)
82+ let C = getStringValue(this, g)
83+ let D = getStringValue(this, h)
84+ let K = getIntegerValue(this, l)
85+ let L = getIntegerValue(this, k)
86+ let M = getIntegerValue(this, i)
87+ if ((t >= G))
8688 then throw("presale has not been started yet")
87- else if ((F >= E))
89+ else if ((G >= F))
8890 then throw("presale has been already ended")
89- else if ((size(q.payments) != 1))
91+ else if ((size(r.payments) != 1))
9092 then throw("exactly 1 payment is expected")
91- else if (if (if ((H != A))
92- then (H != B)
93+ else if (if (if ((I != B))
94+ then (I != C)
9395 else false)
94- then (H != C)
96+ then (I != D)
9597 else false)
96- then throw(((("invalid payment asset id:" + H) + " Expected:") + A))
97- else if ((J >= K))
98+ then throw(((("invalid payment asset id:" + I) + " Expected:") + B))
99+ else if ((K >= L))
98100 then throw("Pre-sale asset has been - sold consider to use smaller payment")
99- else if ((L > I))
101+ else if ((M > J))
100102 then throw("Amount less than the minimum to be invested.")
101103 else {
102- let M = ((I / v) * 100000000)
103-[IntegerEntry(l, (J + M)), BooleanEntry((((m + toBase58String(q.caller.bytes)) + "__") + H), true)]
104+ let N = ((J / w) * o)
105+[IntegerEntry(l, (K + N)), BooleanEntry((((m + toBase58String(r.caller.bytes)) + "__") + I), true)]
104106 }
105107 }
106108
107109
108110
109-@Callable(q)
111+@Callable(r)
110112 func claimPresale () = {
111- let N = (getIntegerValue(this, b) + getIntegerValue(this, a))
112- let u = getIntegerValue(this, n)
113- let O = (N + u)
114- let D = getBinaryValue(this, j)
115- let F = height
116- let v = getIntegerValue(this, e)
117- if ((N >= F))
113+ let O = (getIntegerValue(this, b) + getIntegerValue(this, a))
114+ let v = getIntegerValue(this, n)
115+ let P = (O + v)
116+ let E = getBinaryValue(this, j)
117+ let G = height
118+ let w = getIntegerValue(this, e)
119+ if ((O >= G))
118120 then throw("The Presale is still happening.")
119121 else {
120- let P = if ((F > O))
121- then 100
122- else (F / O)
123- let Q = valueOrErrorMessage(getIntegerValue(this, (m + toBase58String(q.caller.bytes))), "You were not part of the presale")
124- let M = ((Q * P) / 100)
125- let R = (Q - M)
126- if ((valueOrElse(getIntegerValue(this, ("OLD_TOTAL_" + toBase58String(q.caller.bytes))), 0) == 0))
127- then [IntegerEntry((m + toBase58String(q.caller.bytes)), R), ScriptTransfer(q.caller, M, D), IntegerEntry(("OLD_TOTAL_" + toBase58String(q.caller.bytes)), Q)]
128- else [IntegerEntry((m + toBase58String(q.caller.bytes)), R), ScriptTransfer(q.caller, M, D)]
122+ let Q = if ((G > P))
123+ then toBigInt(100)
124+ else ((toBigInt(G) * toBigInt(o)) / (toBigInt(P) * toBigInt(o)))
125+ let R = valueOrErrorMessage(getIntegerValue(this, (m + toBase58String(r.caller.bytes))), "You were not part of the presale")
126+ let N = ((toBigInt(R) * (Q * toBigInt(o))) / toBigInt(100))
127+ let S = (toBigInt(R) - N)
128+ if ((valueOrElse(getIntegerValue(this, ("OLD_TOTAL_" + toBase58String(r.caller.bytes))), 0) == 0))
129+ then [IntegerEntry((m + toBase58String(r.caller.bytes)), toInt(S)), ScriptTransfer(r.caller, toInt(N), E), IntegerEntry(("OLD_TOTAL_" + toBase58String(r.caller.bytes)), R)]
130+ else [IntegerEntry((m + toBase58String(r.caller.bytes)), toInt(S)), ScriptTransfer(r.caller, toInt(N), E)]
129131 }
130132 }
131133
132134
133135
134-@Callable(q)
135-func adminV (S,r,p) = if (if ((q.caller == this))
136+@Callable(r)
137+func adminV (T,s,q) = if (if ((r.caller == this))
136138 then true
137- else (q.caller == Address(getBinaryValue(this, "admin"))))
138- then [ScriptTransfer(Address(fromBase58String(r)), S, fromBase58String(p))]
139+ else (r.caller == Address(getBinaryValue(this, "admin"))))
140+ then [ScriptTransfer(Address(fromBase58String(s)), T, fromBase58String(q))]
139141 else throw("Only the Admin itself can invoke this function")
140142
141143
142-@Verifier(T)
143-func U () = sigVerify(T.bodyBytes, T.proofs[0], T.senderPublicKey)
144+@Verifier(U)
145+func V () = sigVerify(U.bodyBytes, U.proofs[0], U.senderPublicKey)
144146

github/deemru/w8io/169f3d6 
115.48 ms