tx · 45TQ1ASm7ScBMWgse5qhMHiPExM6GBMNWhLisdQnZRvi

3MxfEq17wZjAWQfckWycU9o4oTkvf9nfNQX:  -0.01000000 Waves

2021.12.13 07:13 [1831985] smart account 3MxfEq17wZjAWQfckWycU9o4oTkvf9nfNQX > SELF 0.00000000 Waves

{ "type": 13, "id": "45TQ1ASm7ScBMWgse5qhMHiPExM6GBMNWhLisdQnZRvi", "fee": 1000000, "feeAssetId": null, "timestamp": 1639368838703, "version": 2, "chainId": 84, "sender": "3MxfEq17wZjAWQfckWycU9o4oTkvf9nfNQX", "senderPublicKey": "HUca7AqRs4Zs9sU1AFcufmBC4XpT4sN79aFScNRT4LxQ", "proofs": [ "26ygUPBRJRyRRzpL5wQPARgV4TJyb2Nrd4Jztavk8jvExMejDmj4kkHeWmVXHq54HckdGCxjfsyaHnMdwS3nwUoA" ], "script": "base64:AAIFAAAAAAAAAAsIAhIAEgMKAQgSAAAAAAYAAAAABXRva2VuAQAAACDZi0CLArkkcZNdMZg+wWZc78jMPXwRedDDRg0bRciTFwAAAAAGdG9rZW5kAAAAAAAF9eEAAAAAAAdhaXJkcm9wCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUX+pzJtA2DV6Pr0xhS8z4foIVUAfq2c0IAAAAAAp0ZWFtQWRyZXNzCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUACYJT8ivNONGpFPWk1FdqVPAxApBcmLaAAAAAAhkZWFkbGluZQAAAAF9roOaAAAAAAAMYnVybmRlYWRsaW5lAAAACMRU9bEAAAAAAwAAAAFpAQAAAAVyZXNldAAAAAAJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAVidXJudAAAAAAAAAAAAAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAHZHJvcHBlZAAAAAAAA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AAAAAAAAAAAAJAAEsAAAAAgkAAZEAAAACBQAAAAhkYXRhcmVjcwAAAAAAAAAAAAIAAAAIfGJvdWdodDEDCQAAAAAAAAIFAAAADmNhbGxlckJ1eWxldmVsAAAAAAAAAAABCQABLAAAAAIJAAGRAAAAAgUAAAAIZGF0YXJlY3MAAAAAAAAAAAACAAAAEHxib3VnaHQxfGJvdWdodDICAAAAAAQAAAAEZGVhbAMDAwUAAAAJYmFsYW5jZW9rBQAAAAxjYWxsZXJDYW5CdXkHBQAAAAVwbXRvawcGBwMFAAAABGRlYWwJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBQAAAAduZXdkYXRhCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAACnRlYW1BZHJlc3MFAAAAC2NhbGxlclByaWNlBQAAAAR1bml0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAADGNhbGxlckFkcmVzcwUAAAAKc2VsbGFtb3VudAUAAAAFdG9rZW4JAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAABl9lcnJvcgUAAAADbmlsCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAAZfZXJyb3IFAAAABG1lc3MFAAAAA25pbAAAAABUTu0G", "height": 1831985, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8xBh1FFSKYyeY4PaQzjJstuNoVfPiYBDrYe5em7MT18B Next: E4KrhfLXtqvpnVEHnu45yJiJYEXXbWw3hwWUhifwPuhh Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let token = base58'5RAJjzoFWEqp7TJTHsnGRiJG6xFG2VgpscRpNPrgGu9L'
4+let token = base58'FeCdHqomybB47PWv1JVvfFpQ6WPmHGYgped6WAxpU7Nv'
55
66 let tokend = 100000000
77
88 let airdrop = Address(base58'3MxfEq17wZjAWQfckWycU9o4oTkvf9nfNQX')
99
1010 let teamAdress = Address(base58'3MovsLjXpJr9HD2vBqmAf7Gze6jwuRxX1fX')
11+
12+let deadline = 1639310400000
13+
14+let burndeadline = 9639332000000
1115
1216 @Callable(i)
1317 func reset () = [DeleteEntry(toBase58String(i.caller.bytes)), IntegerEntry("burnt", 0), IntegerEntry("dropped", 0), IntegerEntry("sold1", 0), IntegerEntry("sold2", 0), IntegerEntry("teamgift", 0), IntegerEntry("issued", (1000000000 * 100000000)), StringEntry("burningstage", "waiting"), DeleteEntry((toBase58String(i.caller.bytes) + "_error"))]
2024 let teamgift = (10 * tokend)
2125 let trid = fromBase58String(id58)
2226 let callerAdress = Address(i.caller.bytes)
23- let deadline = 1639310400000
24- let burndeadline = 1639332000000
2527 let currenttime = match blockInfoByHeight(height) {
2628 case block: BlockInfo =>
2729 block.timestamp
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let token = base58'5RAJjzoFWEqp7TJTHsnGRiJG6xFG2VgpscRpNPrgGu9L'
4+let token = base58'FeCdHqomybB47PWv1JVvfFpQ6WPmHGYgped6WAxpU7Nv'
55
66 let tokend = 100000000
77
88 let airdrop = Address(base58'3MxfEq17wZjAWQfckWycU9o4oTkvf9nfNQX')
99
1010 let teamAdress = Address(base58'3MovsLjXpJr9HD2vBqmAf7Gze6jwuRxX1fX')
11+
12+let deadline = 1639310400000
13+
14+let burndeadline = 9639332000000
1115
1216 @Callable(i)
1317 func reset () = [DeleteEntry(toBase58String(i.caller.bytes)), IntegerEntry("burnt", 0), IntegerEntry("dropped", 0), IntegerEntry("sold1", 0), IntegerEntry("sold2", 0), IntegerEntry("teamgift", 0), IntegerEntry("issued", (1000000000 * 100000000)), StringEntry("burningstage", "waiting"), DeleteEntry((toBase58String(i.caller.bytes) + "_error"))]
1418
1519
1620
1721 @Callable(i)
1822 func free (id58) = {
1923 let dropamount = (1000 * tokend)
2024 let teamgift = (10 * tokend)
2125 let trid = fromBase58String(id58)
2226 let callerAdress = Address(i.caller.bytes)
23- let deadline = 1639310400000
24- let burndeadline = 1639332000000
2527 let currenttime = match blockInfoByHeight(height) {
2628 case block: BlockInfo =>
2729 block.timestamp
2830 case _ =>
2931 throw("Can't find block")
3032 }
3133 let balance = assetBalance(airdrop, token)
3234 let burnamount = if (if ((currenttime > burndeadline))
3335 then (getStringValue("burningstage") == "waiting")
3436 else false)
3537 then balance
3638 else 0
3739 let isenough = if ((balance > dropamount))
3840 then true
3941 else false
4042 if ((isenough == isenough))
4143 then {
4244 let trexists = match transferTransactionById(trid) {
4345 case ttx: TransferTransaction =>
4446 true
4547 case _ =>
4648 false
4749 }
4850 let trtime = match transferTransactionById(trid) {
4951 case ttx: TransferTransaction =>
5052 ttx.timestamp
5153 case _ =>
5254 9999999999999
5355 }
5456 let trsender = match transferTransactionById(trid) {
5557 case ttx: TransferTransaction =>
5658 ttx.sender
5759 case _ =>
5860 airdrop
5961 }
6062 let received = if ((take(valueOrElse(getString(toBase58String(i.caller.bytes)), ""), 8) == "received"))
6163 then true
6264 else false
6365 let isprooved = if (if (if (if ((trtime > deadline))
6466 then true
6567 else (callerAdress != trsender))
6668 then true
6769 else received)
6870 then true
6971 else !(isenough))
7072 then false
7173 else true
7274 let result = if (trexists)
7375 then if ((trtime > deadline))
7476 then ("transaction is out of time range: " + toString(trtime))
7577 else ("" + (if ((callerAdress != trsender))
7678 then ((("it is incorrect sender: " + toString(callerAdress)) + " / ") + toString(trsender))
7779 else ("" + (if (received)
7880 then "allready received"
7981 else ("" + (if (isprooved)
8082 then "received"
8183 else ("" + (if (!(isenough))
8284 then (("airdrop ended: " + toString(getIntegerValue("burnt"))) + " burnt")
8385 else ""))))))))
8486 else "can`t find transaction"
8587 if ((burnamount > 0))
8688 then [StringEntry((toBase58String(i.caller.bytes) + "_error"), (("airdrop ended: " + toString(getIntegerValue("burnt"))) + " burnt")), Burn(token, burnamount), StringEntry("burningstage", "them all burnt"), IntegerEntry("burnt", (getIntegerValue("burnt") + burnamount))]
8789 else if (isprooved)
8890 then [ScriptTransfer(callerAdress, dropamount, token), ScriptTransfer(teamAdress, teamgift, token), StringEntry(toBase58String(i.caller.bytes), result), IntegerEntry("dropped", (getIntegerValue("dropped") + dropamount)), IntegerEntry("teamgift", (getIntegerValue("teamgift") + teamgift)), DeleteEntry((toBase58String(i.caller.bytes) + "_error"))]
8991 else [StringEntry((toBase58String(i.caller.bytes) + "_error"), result)]
9092 }
9193 else throw("Strict value is not equal to itself.")
9294 }
9395
9496
9597
9698 @Callable(i)
9799 func buy () = {
98100 let currenttime = match blockInfoByHeight(height) {
99101 case block: BlockInfo =>
100102 block.timestamp
101103 case _ =>
102104 throw("Can't find block")
103105 }
104106 let balance = assetBalance(airdrop, token)
105107 let sellamount = (1000 * tokend)
106108 let price1 = (1 * 100000000)
107109 let price2 = (2 * 100000000)
108110 let callerAdress = Address(i.caller.bytes)
109111 let balanceok = if ((balance >= sellamount))
110112 then true
111113 else false
112114 let callerData = valueOrElse(getString(toBase58String(i.caller.bytes)), "")
113115 let callerReceived = if ((take(callerData, 8) == "received"))
114116 then true
115117 else false
116118 let callerBuylevel = if (if (callerReceived)
117119 then (size(split(callerData, "|")) == 1)
118120 else false)
119121 then 0
120122 else if (if (callerReceived)
121123 then (size(split(callerData, "|")) == 2)
122124 else false)
123125 then 1
124126 else 99
125127 let callerCanBuy = if (if (callerReceived)
126128 then if ((callerBuylevel == 0))
127129 then true
128130 else (callerBuylevel == 1)
129131 else false)
130132 then true
131133 else false
132134 let callerPrice = if ((callerBuylevel == 0))
133135 then price1
134136 else if ((callerBuylevel == 1))
135137 then price2
136138 else 0
137139 let pmtok = if ((size(i.payments) == 1))
138140 then if (if (!(isDefined(i.payments[0].assetId)))
139141 then (i.payments[0].amount >= callerPrice)
140142 else false)
141143 then true
142144 else false
143145 else false
144146 let mess = if (!(callerCanBuy))
145147 then "not prooved for buy"
146148 else ("" + (if (!(pmtok))
147149 then "not enough payment"
148150 else ("" + (if (!(balanceok))
149151 then "ballance empty "
150152 else ""))))
151153 let datarecs = split(callerData, "|")
152154 let newdata = if ((callerBuylevel == 0))
153155 then (datarecs[0] + "|bought1")
154156 else if ((callerBuylevel == 1))
155157 then (datarecs[0] + "|bought1|bought2")
156158 else ""
157159 let deal = if (if (if (balanceok)
158160 then callerCanBuy
159161 else false)
160162 then pmtok
161163 else false)
162164 then true
163165 else false
164166 if (deal)
165167 then [StringEntry(toBase58String(i.caller.bytes), newdata), ScriptTransfer(teamAdress, callerPrice, unit), ScriptTransfer(callerAdress, sellamount, token), DeleteEntry((toBase58String(i.caller.bytes) + "_error"))]
166168 else [StringEntry((toBase58String(i.caller.bytes) + "_error"), mess)]
167169 }
168170
169171

github/deemru/w8io/026f985 
27.44 ms