tx · HBPfn3XKJCRNCXJiBnPWVppmx8TE6SUGH3BrYnwho3bw

3Mw7mAf2p8drjeSSDEbq6yyFhjqTgDcwGFB:  -0.04000000 Waves

2022.05.05 18:47 [2038595] smart account 3Mw7mAf2p8drjeSSDEbq6yyFhjqTgDcwGFB > SELF 0.00000000 Waves

{ "type": 13, "id": "HBPfn3XKJCRNCXJiBnPWVppmx8TE6SUGH3BrYnwho3bw", "fee": 4000000, "feeAssetId": null, "timestamp": 1651765646309, "version": 2, "chainId": 84, "sender": "3Mw7mAf2p8drjeSSDEbq6yyFhjqTgDcwGFB", "senderPublicKey": "Ti5K4A5REvfgdfj3SWhhb2wJXRKenVb3WPQ6tE1TaKe", "proofs": [ "2rxqyGdk3wMKvoHnJt6XUGd2cQqq2wpnF2rEBKKy5xkx8ybTJzytAdSfbw5vqazsgMR4JgFVb2n8MrRDfzHKPLA2" ], "script": "base64:AAIFAAAAAAAAABgIAhIDCgEIEgsKCQEBAQEBCAgIARIAEgAAAAAOAAAAAAJwcwIAAAANUFJFU0FMRV9TVEFSVAAAAAACcGQCAAAAEFBSRVNBTEVfRFVSQVRJT04AAAAAAmNzAgAAAAtDTEFJTV9TVEFSVAAAAAACY2QCAAAADkNMQUlNX0RVUkFUSU9OAAAAAAFwAgAAAAlQUklDRV9JRE8AAAAABHAxSUQCAAAAEFBSSUNFXzFfQVNTRVRfSUQAAAAABHAySUQCAAAAEFBSSUNFXzJfQVNTRVRfSUQAAAAABHAzSUQCAAAAEFBSSUNFXzNfQVNTRVRfSUQAAAAAA21pYQIAAAARTUlOX0FNT1VOVF9JTlZFU1QAAAAABW1haW5hAgAAAApNQUlOX0FTU0VUAAAAAAdmb3JTYWxlAgAAAA5UT1RBTF9GT1JfU0FMRQAAAAAJdG90YWxTYWxlAgAAAApUT1RBTF9TQUxFAAAAAAd0aW52ZXN0AgAAAA1UT1RBTF9JTlZFU1RfAQAAAA9nZXRBc3NldElmVmFsaWQAAAABAAAAB2Fzc2V0SWQJAAJYA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bc3NldAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkeaMJ1", "height": 2038595, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 37ueSBJtFKWQSaNpAYgSJUU4heZaNYL34xdL32ouqfms Next: A1PcvppsMLL2hUZUY3ufoEgLLBsf3SxmNP13yZ58Bpxk Diff:
OldNewDifferences
3131
3232
3333 @Callable(p)
34-func constructor (q,r,s,t,u,v,w,x,y) = {
35- let z = n(v)
34+func addAdmin (q) = if ((p.caller == this))
35+ then [BinaryEntry("admin", fromBase58String(q))]
36+ else throw("Only the Admin itself can invoke this function")
37+
38+
39+
40+@Callable(p)
41+func constructor (r,s,t,u,v,w,x,y,z) = {
3642 let A = n(w)
3743 let B = n(x)
38- if ((p.caller == this))
39- then if ((r >= q))
44+ let C = n(y)
45+ if (if ((p.caller == this))
46+ then true
47+ else (p.caller == Address(getBinaryValue(this, "admin"))))
48+ then if ((s >= r))
4049 then throw("PresaleDuration can't be bigger than PresaleStart")
41- else if ((r >= s))
50+ else if ((s >= t))
4251 then throw("presaleDuration can't be bigger than claimStart")
43- else if ((t >= s))
52+ else if ((u >= t))
4453 then throw("claimDuration can't be bigger than claimStart")
45- else if ((y >= u))
54+ else if ((z >= v))
4655 then throw("minInvestAmount can't be bigger than price")
47- else if (if (if ((z == A))
56+ else if (if (if ((A == B))
4857 then true
49- else (z == B))
58+ else (A == C))
5059 then true
51- else (A == B))
60+ else (B == C))
5261 then throw("Each Asset must be different from the other.")
5362 else if ((size(p.payments) != 1))
5463 then throw("exactly 1 payment must be attached")
55- else [BinaryEntry(j, value(p.payments[0].assetId)), StringEntry(f, v), StringEntry(g, w), StringEntry(h, x), IntegerEntry(a, q), IntegerEntry(b, r), IntegerEntry(c, s), IntegerEntry(d, t), IntegerEntry(e, u), IntegerEntry(i, y), IntegerEntry(k, value(p.payments[0]).amount), IntegerEntry(l, 0)]
64+ else [BinaryEntry(j, value(p.payments[0].assetId)), StringEntry(f, w), StringEntry(g, x), StringEntry(h, y), IntegerEntry(a, r), IntegerEntry(b, s), IntegerEntry(c, t), IntegerEntry(d, u), IntegerEntry(e, v), IntegerEntry(i, z), IntegerEntry(k, value(p.payments[0]).amount), IntegerEntry(l, 0)]
5665 else throw("Only the Admin itself can invoke this function")
5766 }
5867
6069
6170 @Callable(p)
6271 func invest () = {
63- let C = getBinary(this, j)
64- let q = getIntegerValue(this, a)
65- let r = getIntegerValue(this, b)
66- let D = (q + r)
67- let u = getIntegerValue(this, e)
68- let E = height
69- let F = value(p.payments[0])
70- let G = value(F.assetId)
71- let H = F.amount
72- let z = fromBase58String(getStringValue(this, f))
73- let A = fromBase58String(getStringValue(this, g))
74- let B = fromBase58String(getStringValue(this, h))
75- let I = getIntegerValue(this, l)
76- let J = getIntegerValue(this, k)
77- let K = getIntegerValue(this, i)
78- if ((q >= E))
72+ let D = getBinary(this, j)
73+ let r = getIntegerValue(this, a)
74+ let s = getIntegerValue(this, b)
75+ let E = (r + s)
76+ let v = getIntegerValue(this, e)
77+ let F = height
78+ let G = value(p.payments[0])
79+ let H = value(G.assetId)
80+ let I = G.amount
81+ let A = fromBase58String(getStringValue(this, f))
82+ let B = fromBase58String(getStringValue(this, g))
83+ let C = fromBase58String(getStringValue(this, h))
84+ let J = getIntegerValue(this, l)
85+ let K = getIntegerValue(this, k)
86+ let L = getIntegerValue(this, i)
87+ if ((r >= F))
7988 then throw("presale has not been started yet")
80- else if ((E >= D))
89+ else if ((F >= E))
8190 then throw("presale has been already ended")
8291 else if ((size(p.payments) != 1))
8392 then throw("exactly 1 payment is expected")
84- else if (if (if ((G != z))
93+ else if (if (if ((H != A))
8594 then true
86- else (G != A))
95+ else (H != B))
8796 then true
88- else (G != B))
97+ else (H != C))
8998 then throw("invalid payment asset id")
90- else if ((I >= J))
99+ else if ((J >= K))
91100 then throw("Pre-sale asset has been - sold consider to use smaller payment")
92- else if ((K > H))
101+ else if ((L > I))
93102 then throw("Amount less than the minimum to be invested.")
94103 else {
95- let L = valueOrElse(getIntegerValue(this, (m + toBase58String(p.caller.bytes))), 0)
96- let M = (H / u)
97- let N = (H + L)
98-[IntegerEntry((m + toBase58String(p.caller.bytes)), N), IntegerEntry(l, (I + M)), BooleanEntry((((m + toBase58String(p.caller.bytes)) + "__") + toBase58String(G)), true)]
104+ let M = valueOrElse(getIntegerValue(this, (m + toBase58String(p.caller.bytes))), 0)
105+ let N = (I / v)
106+ let O = (I + M)
107+[IntegerEntry((m + toBase58String(p.caller.bytes)), O), IntegerEntry(l, (J + N)), BooleanEntry((((m + toBase58String(p.caller.bytes)) + "__") + toBase58String(H)), true)]
99108 }
100109 }
101110
103112
104113 @Callable(p)
105114 func claimPresale () = {
106- let C = getBinary(this, j)
107- let E = height
108- let O = getIntegerValue(this, c)
109- let P = getIntegerValue(this, d)
110- let Q = (O + P)
111- let u = getIntegerValue(this, e)
112- if ((O >= E))
115+ let D = getBinary(this, j)
116+ let F = height
117+ let P = getIntegerValue(this, c)
118+ let Q = getIntegerValue(this, d)
119+ let R = (P + Q)
120+ let v = getIntegerValue(this, e)
121+ if ((P >= F))
113122 then throw("The Presale is still happening.")
114- else if ((E > Q))
123+ else if ((F > R))
115124 then {
116- let L = valueOrErrorMessage(getIntegerValue(this, (m + toBase58String(p.caller.bytes))), "You were not part of the presale")
117- let M = (L / u)
118- let R = (M / P)
119- let S = valueOrElse(getIntegerValue(this, ((m + toBase58String(p.caller.bytes)) + "_HISTORY")), 0)
120- let T = (P - S)
121- let U = (R * T)
122-[IntegerEntry(((m + toBase58String(p.caller.bytes)) + "_HISTORY"), (E - O)), IntegerEntry((m + toBase58String(p.caller.bytes)), (L - (U * u))), ScriptTransfer(p.caller, U, C)]
125+ let M = valueOrErrorMessage(getIntegerValue(this, (m + toBase58String(p.caller.bytes))), "You were not part of the presale")
126+ let N = (M / v)
127+ let S = (N / Q)
128+ let T = valueOrElse(getIntegerValue(this, ((m + toBase58String(p.caller.bytes)) + "_HISTORY")), 0)
129+ let U = (Q - T)
130+ let V = (S * U)
131+[IntegerEntry(((m + toBase58String(p.caller.bytes)) + "_HISTORY"), (F - P)), IntegerEntry((m + toBase58String(p.caller.bytes)), (M - (V * v))), ScriptTransfer(p.caller, V, D)]
123132 }
124133 else {
125- let L = valueOrErrorMessage(getIntegerValue(this, (m + toBase58String(p.caller.bytes))), "You were not part of the presale")
126- let M = (L / u)
127- let R = (M / P)
128- let S = valueOrElse(getIntegerValue(this, ((m + toBase58String(p.caller.bytes)) + "_HISTORY")), 0)
129- let T = ((P - S) - (E - O))
130- let U = (R * T)
131-[IntegerEntry(((m + toBase58String(p.caller.bytes)) + "_HISTORY"), (E - O)), IntegerEntry((m + toBase58String(p.caller.bytes)), (L - (U * u))), ScriptTransfer(p.caller, U, C)]
134+ let M = valueOrErrorMessage(getIntegerValue(this, (m + toBase58String(p.caller.bytes))), "You were not part of the presale")
135+ let N = (M / v)
136+ let S = (N / Q)
137+ let T = valueOrElse(getIntegerValue(this, ((m + toBase58String(p.caller.bytes)) + "_HISTORY")), 0)
138+ let U = ((Q - T) - (F - P))
139+ let V = (S * U)
140+[IntegerEntry(((m + toBase58String(p.caller.bytes)) + "_HISTORY"), (F - P)), IntegerEntry((m + toBase58String(p.caller.bytes)), (M - (V * v))), ScriptTransfer(p.caller, V, D)]
132141 }
133142 }
134143
135144
136-@Verifier(V)
137-func W () = sigVerify(V.bodyBytes, V.proofs[0], V.senderPublicKey)
145+@Verifier(W)
146+func X () = sigVerify(W.bodyBytes, W.proofs[0], W.senderPublicKey)
138147
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 func n (o) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(o))).id, (("Asset Id: " + o) + " is invalid.")))
3131
3232
3333 @Callable(p)
34-func constructor (q,r,s,t,u,v,w,x,y) = {
35- let z = n(v)
34+func addAdmin (q) = if ((p.caller == this))
35+ then [BinaryEntry("admin", fromBase58String(q))]
36+ else throw("Only the Admin itself can invoke this function")
37+
38+
39+
40+@Callable(p)
41+func constructor (r,s,t,u,v,w,x,y,z) = {
3642 let A = n(w)
3743 let B = n(x)
38- if ((p.caller == this))
39- then if ((r >= q))
44+ let C = n(y)
45+ if (if ((p.caller == this))
46+ then true
47+ else (p.caller == Address(getBinaryValue(this, "admin"))))
48+ then if ((s >= r))
4049 then throw("PresaleDuration can't be bigger than PresaleStart")
41- else if ((r >= s))
50+ else if ((s >= t))
4251 then throw("presaleDuration can't be bigger than claimStart")
43- else if ((t >= s))
52+ else if ((u >= t))
4453 then throw("claimDuration can't be bigger than claimStart")
45- else if ((y >= u))
54+ else if ((z >= v))
4655 then throw("minInvestAmount can't be bigger than price")
47- else if (if (if ((z == A))
56+ else if (if (if ((A == B))
4857 then true
49- else (z == B))
58+ else (A == C))
5059 then true
51- else (A == B))
60+ else (B == C))
5261 then throw("Each Asset must be different from the other.")
5362 else if ((size(p.payments) != 1))
5463 then throw("exactly 1 payment must be attached")
55- else [BinaryEntry(j, value(p.payments[0].assetId)), StringEntry(f, v), StringEntry(g, w), StringEntry(h, x), IntegerEntry(a, q), IntegerEntry(b, r), IntegerEntry(c, s), IntegerEntry(d, t), IntegerEntry(e, u), IntegerEntry(i, y), IntegerEntry(k, value(p.payments[0]).amount), IntegerEntry(l, 0)]
64+ else [BinaryEntry(j, value(p.payments[0].assetId)), StringEntry(f, w), StringEntry(g, x), StringEntry(h, y), IntegerEntry(a, r), IntegerEntry(b, s), IntegerEntry(c, t), IntegerEntry(d, u), IntegerEntry(e, v), IntegerEntry(i, z), IntegerEntry(k, value(p.payments[0]).amount), IntegerEntry(l, 0)]
5665 else throw("Only the Admin itself can invoke this function")
5766 }
5867
5968
6069
6170 @Callable(p)
6271 func invest () = {
63- let C = getBinary(this, j)
64- let q = getIntegerValue(this, a)
65- let r = getIntegerValue(this, b)
66- let D = (q + r)
67- let u = getIntegerValue(this, e)
68- let E = height
69- let F = value(p.payments[0])
70- let G = value(F.assetId)
71- let H = F.amount
72- let z = fromBase58String(getStringValue(this, f))
73- let A = fromBase58String(getStringValue(this, g))
74- let B = fromBase58String(getStringValue(this, h))
75- let I = getIntegerValue(this, l)
76- let J = getIntegerValue(this, k)
77- let K = getIntegerValue(this, i)
78- if ((q >= E))
72+ let D = getBinary(this, j)
73+ let r = getIntegerValue(this, a)
74+ let s = getIntegerValue(this, b)
75+ let E = (r + s)
76+ let v = getIntegerValue(this, e)
77+ let F = height
78+ let G = value(p.payments[0])
79+ let H = value(G.assetId)
80+ let I = G.amount
81+ let A = fromBase58String(getStringValue(this, f))
82+ let B = fromBase58String(getStringValue(this, g))
83+ let C = fromBase58String(getStringValue(this, h))
84+ let J = getIntegerValue(this, l)
85+ let K = getIntegerValue(this, k)
86+ let L = getIntegerValue(this, i)
87+ if ((r >= F))
7988 then throw("presale has not been started yet")
80- else if ((E >= D))
89+ else if ((F >= E))
8190 then throw("presale has been already ended")
8291 else if ((size(p.payments) != 1))
8392 then throw("exactly 1 payment is expected")
84- else if (if (if ((G != z))
93+ else if (if (if ((H != A))
8594 then true
86- else (G != A))
95+ else (H != B))
8796 then true
88- else (G != B))
97+ else (H != C))
8998 then throw("invalid payment asset id")
90- else if ((I >= J))
99+ else if ((J >= K))
91100 then throw("Pre-sale asset has been - sold consider to use smaller payment")
92- else if ((K > H))
101+ else if ((L > I))
93102 then throw("Amount less than the minimum to be invested.")
94103 else {
95- let L = valueOrElse(getIntegerValue(this, (m + toBase58String(p.caller.bytes))), 0)
96- let M = (H / u)
97- let N = (H + L)
98-[IntegerEntry((m + toBase58String(p.caller.bytes)), N), IntegerEntry(l, (I + M)), BooleanEntry((((m + toBase58String(p.caller.bytes)) + "__") + toBase58String(G)), true)]
104+ let M = valueOrElse(getIntegerValue(this, (m + toBase58String(p.caller.bytes))), 0)
105+ let N = (I / v)
106+ let O = (I + M)
107+[IntegerEntry((m + toBase58String(p.caller.bytes)), O), IntegerEntry(l, (J + N)), BooleanEntry((((m + toBase58String(p.caller.bytes)) + "__") + toBase58String(H)), true)]
99108 }
100109 }
101110
102111
103112
104113 @Callable(p)
105114 func claimPresale () = {
106- let C = getBinary(this, j)
107- let E = height
108- let O = getIntegerValue(this, c)
109- let P = getIntegerValue(this, d)
110- let Q = (O + P)
111- let u = getIntegerValue(this, e)
112- if ((O >= E))
115+ let D = getBinary(this, j)
116+ let F = height
117+ let P = getIntegerValue(this, c)
118+ let Q = getIntegerValue(this, d)
119+ let R = (P + Q)
120+ let v = getIntegerValue(this, e)
121+ if ((P >= F))
113122 then throw("The Presale is still happening.")
114- else if ((E > Q))
123+ else if ((F > R))
115124 then {
116- let L = valueOrErrorMessage(getIntegerValue(this, (m + toBase58String(p.caller.bytes))), "You were not part of the presale")
117- let M = (L / u)
118- let R = (M / P)
119- let S = valueOrElse(getIntegerValue(this, ((m + toBase58String(p.caller.bytes)) + "_HISTORY")), 0)
120- let T = (P - S)
121- let U = (R * T)
122-[IntegerEntry(((m + toBase58String(p.caller.bytes)) + "_HISTORY"), (E - O)), IntegerEntry((m + toBase58String(p.caller.bytes)), (L - (U * u))), ScriptTransfer(p.caller, U, C)]
125+ let M = valueOrErrorMessage(getIntegerValue(this, (m + toBase58String(p.caller.bytes))), "You were not part of the presale")
126+ let N = (M / v)
127+ let S = (N / Q)
128+ let T = valueOrElse(getIntegerValue(this, ((m + toBase58String(p.caller.bytes)) + "_HISTORY")), 0)
129+ let U = (Q - T)
130+ let V = (S * U)
131+[IntegerEntry(((m + toBase58String(p.caller.bytes)) + "_HISTORY"), (F - P)), IntegerEntry((m + toBase58String(p.caller.bytes)), (M - (V * v))), ScriptTransfer(p.caller, V, D)]
123132 }
124133 else {
125- let L = valueOrErrorMessage(getIntegerValue(this, (m + toBase58String(p.caller.bytes))), "You were not part of the presale")
126- let M = (L / u)
127- let R = (M / P)
128- let S = valueOrElse(getIntegerValue(this, ((m + toBase58String(p.caller.bytes)) + "_HISTORY")), 0)
129- let T = ((P - S) - (E - O))
130- let U = (R * T)
131-[IntegerEntry(((m + toBase58String(p.caller.bytes)) + "_HISTORY"), (E - O)), IntegerEntry((m + toBase58String(p.caller.bytes)), (L - (U * u))), ScriptTransfer(p.caller, U, C)]
134+ let M = valueOrErrorMessage(getIntegerValue(this, (m + toBase58String(p.caller.bytes))), "You were not part of the presale")
135+ let N = (M / v)
136+ let S = (N / Q)
137+ let T = valueOrElse(getIntegerValue(this, ((m + toBase58String(p.caller.bytes)) + "_HISTORY")), 0)
138+ let U = ((Q - T) - (F - P))
139+ let V = (S * U)
140+[IntegerEntry(((m + toBase58String(p.caller.bytes)) + "_HISTORY"), (F - P)), IntegerEntry((m + toBase58String(p.caller.bytes)), (M - (V * v))), ScriptTransfer(p.caller, V, D)]
132141 }
133142 }
134143
135144
136-@Verifier(V)
137-func W () = sigVerify(V.bodyBytes, V.proofs[0], V.senderPublicKey)
145+@Verifier(W)
146+func X () = sigVerify(W.bodyBytes, W.proofs[0], W.senderPublicKey)
138147

github/deemru/w8io/169f3d6 
65.67 ms