tx · BZNSnVAWrCks9C52b5KZRbdHRqDsXk28fhMmhjHedh6h

3MvMpGD5MxbUW2EJn6jtViDu6NHNqu8PKq8:  -0.01100000 Waves

2022.08.26 05:35 [2200854] smart account 3MvMpGD5MxbUW2EJn6jtViDu6NHNqu8PKq8 > SELF 0.00000000 Waves

{ "type": 13, "id": "BZNSnVAWrCks9C52b5KZRbdHRqDsXk28fhMmhjHedh6h", "fee": 1100000, "feeAssetId": null, "timestamp": 1661481318544, "version": 2, "chainId": 84, "sender": "3MvMpGD5MxbUW2EJn6jtViDu6NHNqu8PKq8", "senderPublicKey": "2MhVDhjG7eJ6SY8og2HRd4Bam75FsCSg2Vude8gutmZe", "proofs": [ "2D7pf54gRSdu3ggwVbr3ppz6cc5h1ixhgW4xwPMnWq98cuqeqxgYTEYrGV9uPEztaoZzhg5J7oHTZo8NUDrAYXZ2" ], "script": "base64:AAIFAAAAAAAAAB4IAhIDCgEIEgoKCAEBAQEICAgBEgASABIFCgMBCAgAAAAQAAAAAAJwcwIAAAANUFJFU0FMRV9TVEFSVAAAAAACcGQCAAAAEFBSRVNBTEVfRFVSQVRJT04AAAAAAmNzAgAAAAtDTEFJTV9TVEFSVAAAAAACY2QCAAAADkNMQUlNX0RVUkFUSU9OAAAAAAFwAgAAAAlQUklDRV9JRE8AAAAABHAxSUQCAAAAEFBSSUNFXzFfQVNTRVRfSUQAAAAABHAySUQCAAAAEFBSSUNFXzJfQVNTRVRfSUQAAAAABHAzSUQCAAAAEFBSSUNFXzNfQVNTRVRfSUQAAAAAA21pYQIAAAARTUlOX0FNT1VOVF9JTlZFU1QAAAAABW1haW5hAgAAAApNQUlOX0FTU0VUAAAAAAdmb3JTYWxlAgAAAA5UT1RBTF9GT1JfU0FMRQAAAAAJdG90YWxTYWxlAgAAAApUT1RBTF9TQUxFAAAAAAd0aW52ZXN0AgAAAA1UT1RBTF9JTlZFU1RfAAAAAAVkaXNkdQIAAAAVRElTVFJJQlVUSU9OX0RVUkFUSU9OAAAAA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AAAAGYWRtaW5WAAAAAwAAAAVWYWx1ZQAAAAdhZGRyZXNzAAAAB2Fzc2V0SWQDAwkAAAAAAAACCAUAAAABaQAAAAZjYWxsZXIFAAAABHRoaXMGCQAAAAAAAAIIBQAAAAFpAAAABmNhbGxlcgkBAAAAB0FkZHJlc3MAAAABCQEAAAARQGV4dHJOYXRpdmUoMTA1MikAAAACBQAAAAR0aGlzAgAAAAVhZG1pbgkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAHQWRkcmVzcwAAAAEJAAJZAAAAAQUAAAAHYWRkcmVzcwUAAAAFVmFsdWUJAAJZAAAAAQUAAAAHYXNzZXRJZAUAAAADbmlsCQAAAgAAAAECAAAALk9ubHkgdGhlIEFkbWluIGl0c2VsZiBjYW4gaW52b2tlIHRoaXMgZnVuY3Rpb24AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleWjWEVM=", "height": 2200854, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7DSGgVGHP2fkHW1NZrpYQYYQdpHoWmbRDFPxqnp6j2W3 Next: FUuy2imJUhKk2AUAx3tNTVdSNUX8ebLuAoTqbqBwzzy6 Diff:
OldNewDifferences
110110
111111 @Callable(r)
112112 func claimPresale () = {
113- let O = (getIntegerValue(this, b) + getIntegerValue(this, a))
113+ let O = getIntegerValue(this, b)
114+ let P = getIntegerValue(this, a)
115+ let Q = (O + P)
114116 let v = getIntegerValue(this, n)
115- let P = (O + v)
117+ let R = (Q + v)
116118 let E = getBinaryValue(this, j)
117119 let G = height
118120 let w = getIntegerValue(this, e)
119- if ((O >= G))
121+ if ((Q >= G))
120122 then throw("The Presale is still happening.")
121123 else {
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- let T = {
129- let U = getInteger(this, ("OLD_TOTAL_" + toBase58String(r.caller.bytes)))
130- if ($isInstanceOf(U, "Int"))
124+ let S = {
125+ let T = getInteger(this, (m + toBase58String(r.caller.bytes)))
126+ if ($isInstanceOf(T, "Int"))
131127 then {
132- let V = U
133- V
128+ let U = T
129+ U
134130 }
135131 else 0
136132 }
137- if ((T == 0))
138- then [IntegerEntry((m + toBase58String(r.caller.bytes)), toInt(S)), ScriptTransfer(r.caller, toInt(N), E), IntegerEntry(("OLD_TOTAL_" + toBase58String(r.caller.bytes)), R)]
139- else [IntegerEntry((m + toBase58String(r.caller.bytes)), toInt(S)), ScriptTransfer(r.caller, toInt(N), E)]
133+ let V = if ((G > R))
134+ then toBigInt(100)
135+ else ((toBigInt(G) * toBigInt(o)) / (toBigInt(R) * toBigInt(o)))
136+ let W = if ((S == 0))
137+ then throw("You were not part of the presale")
138+ else S
139+ let N = ((toBigInt(W) * (V * toBigInt(o))) / toBigInt(100))
140+ let X = (toBigInt(W) - N)
141+ let Y = {
142+ let T = getInteger(this, ("OLD_TOTAL_" + toBase58String(r.caller.bytes)))
143+ if ($isInstanceOf(T, "Int"))
144+ then {
145+ let Z = T
146+ Z
147+ }
148+ else 0
149+ }
150+ if ((Y == 0))
151+ then [IntegerEntry((m + toBase58String(r.caller.bytes)), toInt(X)), ScriptTransfer(r.caller, toInt(N), E), IntegerEntry(("OLD_TOTAL_" + toBase58String(r.caller.bytes)), W)]
152+ else [IntegerEntry((m + toBase58String(r.caller.bytes)), toInt(X)), ScriptTransfer(r.caller, toInt(N), E)]
140153 }
141154 }
142155
143156
144157
145158 @Callable(r)
146-func adminV (W,s,q) = if (if ((r.caller == this))
159+func adminV (aa,s,q) = if (if ((r.caller == this))
147160 then true
148161 else (r.caller == Address(getBinaryValue(this, "admin"))))
149- then [ScriptTransfer(Address(fromBase58String(s)), W, fromBase58String(q))]
162+ then [ScriptTransfer(Address(fromBase58String(s)), aa, fromBase58String(q))]
150163 else throw("Only the Admin itself can invoke this function")
151164
152165
153-@Verifier(X)
154-func Y () = sigVerify(X.bodyBytes, X.proofs[0], X.senderPublicKey)
166+@Verifier(ab)
167+func ac () = sigVerify(ab.bodyBytes, ab.proofs[0], ab.senderPublicKey)
155168
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
3232 let o = 100000000
3333
3434 func p (q) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(q))).id, (("Asset Id: " + q) + " is invalid.")))
3535
3636
3737 @Callable(r)
3838 func addAdmin (s) = if ((r.caller == this))
3939 then [BinaryEntry("admin", fromBase58String(s))]
4040 else throw("Only the Admin itself can invoke this function")
4141
4242
4343
4444 @Callable(r)
4545 func constructor (t,u,v,w,x,y,z,A) = {
4646 let B = p(x)
4747 let C = p(y)
4848 let D = p(z)
4949 if (if ((r.caller == this))
5050 then true
5151 else (r.caller == Address(getBinaryValue(this, "admin"))))
5252 then if ((u >= t))
5353 then throw("PresaleDuration can't be bigger than PresaleStart")
5454 else if ((A > w))
5555 then throw("minInvestAmount can't be bigger than price")
5656 else if (if (if ((B == C))
5757 then true
5858 else (B == D))
5959 then true
6060 else (C == D))
6161 then throw("Each Asset must be different from the other.")
6262 else if ((size(r.payments) != 1))
6363 then throw("exactly 1 payment must be attached")
6464 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)]
6565 else throw("Only the Admin itself can invoke this function")
6666 }
6767
6868
6969
7070 @Callable(r)
7171 func invest () = {
7272 let E = getBinaryValue(this, j)
7373 let t = getIntegerValue(this, a)
7474 let u = getIntegerValue(this, b)
7575 let F = (t + u)
7676 let w = getIntegerValue(this, e)
7777 let G = height
7878 let H = value(r.payments[0])
7979 let I = toBase58String(value(H.assetId))
8080 let J = H.amount
8181 let B = getStringValue(this, f)
8282 let C = getStringValue(this, g)
8383 let D = getStringValue(this, h)
8484 let K = getIntegerValue(this, l)
8585 let L = getIntegerValue(this, k)
8686 let M = getIntegerValue(this, i)
8787 if ((t >= G))
8888 then throw("presale has not been started yet")
8989 else if ((G >= F))
9090 then throw("presale has been already ended")
9191 else if ((size(r.payments) != 1))
9292 then throw("exactly 1 payment is expected")
9393 else if (if (if ((I != B))
9494 then (I != C)
9595 else false)
9696 then (I != D)
9797 else false)
9898 then throw(((("invalid payment asset id:" + I) + " Expected:") + B))
9999 else if ((K >= L))
100100 then throw("Pre-sale asset has been - sold consider to use smaller payment")
101101 else if ((M > J))
102102 then throw("Amount less than the minimum to be invested.")
103103 else {
104104 let N = ((J / w) * o)
105105 [IntegerEntry(l, (K + N)), BooleanEntry((((m + toBase58String(r.caller.bytes)) + "__") + I), true)]
106106 }
107107 }
108108
109109
110110
111111 @Callable(r)
112112 func claimPresale () = {
113- let O = (getIntegerValue(this, b) + getIntegerValue(this, a))
113+ let O = getIntegerValue(this, b)
114+ let P = getIntegerValue(this, a)
115+ let Q = (O + P)
114116 let v = getIntegerValue(this, n)
115- let P = (O + v)
117+ let R = (Q + v)
116118 let E = getBinaryValue(this, j)
117119 let G = height
118120 let w = getIntegerValue(this, e)
119- if ((O >= G))
121+ if ((Q >= G))
120122 then throw("The Presale is still happening.")
121123 else {
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- let T = {
129- let U = getInteger(this, ("OLD_TOTAL_" + toBase58String(r.caller.bytes)))
130- if ($isInstanceOf(U, "Int"))
124+ let S = {
125+ let T = getInteger(this, (m + toBase58String(r.caller.bytes)))
126+ if ($isInstanceOf(T, "Int"))
131127 then {
132- let V = U
133- V
128+ let U = T
129+ U
134130 }
135131 else 0
136132 }
137- if ((T == 0))
138- then [IntegerEntry((m + toBase58String(r.caller.bytes)), toInt(S)), ScriptTransfer(r.caller, toInt(N), E), IntegerEntry(("OLD_TOTAL_" + toBase58String(r.caller.bytes)), R)]
139- else [IntegerEntry((m + toBase58String(r.caller.bytes)), toInt(S)), ScriptTransfer(r.caller, toInt(N), E)]
133+ let V = if ((G > R))
134+ then toBigInt(100)
135+ else ((toBigInt(G) * toBigInt(o)) / (toBigInt(R) * toBigInt(o)))
136+ let W = if ((S == 0))
137+ then throw("You were not part of the presale")
138+ else S
139+ let N = ((toBigInt(W) * (V * toBigInt(o))) / toBigInt(100))
140+ let X = (toBigInt(W) - N)
141+ let Y = {
142+ let T = getInteger(this, ("OLD_TOTAL_" + toBase58String(r.caller.bytes)))
143+ if ($isInstanceOf(T, "Int"))
144+ then {
145+ let Z = T
146+ Z
147+ }
148+ else 0
149+ }
150+ if ((Y == 0))
151+ then [IntegerEntry((m + toBase58String(r.caller.bytes)), toInt(X)), ScriptTransfer(r.caller, toInt(N), E), IntegerEntry(("OLD_TOTAL_" + toBase58String(r.caller.bytes)), W)]
152+ else [IntegerEntry((m + toBase58String(r.caller.bytes)), toInt(X)), ScriptTransfer(r.caller, toInt(N), E)]
140153 }
141154 }
142155
143156
144157
145158 @Callable(r)
146-func adminV (W,s,q) = if (if ((r.caller == this))
159+func adminV (aa,s,q) = if (if ((r.caller == this))
147160 then true
148161 else (r.caller == Address(getBinaryValue(this, "admin"))))
149- then [ScriptTransfer(Address(fromBase58String(s)), W, fromBase58String(q))]
162+ then [ScriptTransfer(Address(fromBase58String(s)), aa, fromBase58String(q))]
150163 else throw("Only the Admin itself can invoke this function")
151164
152165
153-@Verifier(X)
154-func Y () = sigVerify(X.bodyBytes, X.proofs[0], X.senderPublicKey)
166+@Verifier(ab)
167+func ac () = sigVerify(ab.bodyBytes, ab.proofs[0], ab.senderPublicKey)
155168

github/deemru/w8io/169f3d6 
41.58 ms