tx · 85gpZfgFMmUQNQpmkjP2FaMhNDZVFvvE53GNeLzADvRL 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV: -0.01000000 Waves 2021.12.11 11:45 [1829350] smart account 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV > SELF 0.00000000 Waves
{ "type": 13, "id": "85gpZfgFMmUQNQpmkjP2FaMhNDZVFvvE53GNeLzADvRL", "fee": 1000000, "feeAssetId": null, "timestamp": 1639212349801, "version": 2, "chainId": 84, "sender": "3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV", "senderPublicKey": "5amLtMwixiEesBDKPy9dkFWntG2fNxhTs5n69JbQE9F7", "proofs": [ "3j6iWEcz4x38yTNrzyf8ZDqaP44bP4jB7LGSZ6jHxXfuuR8FwTiQUjAHNd4kSQAUNz1ua6xBqkb3xSmzucJL63gF" ], "script": "base64:AAIFAAAAAAAAAAkIAhIAEgMKAQgAAAACAAAAAAV0b2tlbgEAAAAg5zmYC5DQKkfOfYR6rLZt3/lvGLH9m+/aCHI3ec3qXmYAAAAAB2FpcmRyb3AJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVS+Xxmw1G5CNHxEd2QN+w1gvRpGRxhc54oAAAACAAAAAWkBAAAABXJlc2V0AAAAAAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADGJ1cm5pbmdzdGFnZQAAAAAAAAAAAAUAAAADbmlsAAAAAWkBAAAABGNhbGwAAAABAAAABGlkNTgEAAAAC2N1cnJlbnR0aW1lBAAAAAckbWF0Y2gwCQAD7QAAAAEFAAAABmhlaWdodAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAJQmxvY2tJbmZvBAAAAAVibG9jawUAAAAHJG1hdGNoMAgFAAAABWJsb2NrAAAACXRpbWVzdGFtcAkAAAIAAAABAgAA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AEsAAAAAgIAAAAMcmVzZWl2ZWQgaW4gCQABpAAAAAEFAAAAC2N1cnJlbnR0aW1lAgAAAAACAAAAFWNhbnQgZmluZCB0cmFuc2FjdGlvbgMFAAAACWlzcHJvb3ZlZAMJAABmAAAAAgUAAAAKYnVybmFtb3VudAAAAAAAAAAAAAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAxjYWxsZXJBZHJlc3MFAAAACmRyb3BhbW91bnQFAAAABXRva2VuCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwUAAAAGcmVzdWx0CQAETAAAAAIJAQAAAARCdXJuAAAAAgUAAAAFdG9rZW4AAAAAAAAAA+cFAAAAA25pbAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBQAAAAtjdXJyZW50dGltZQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAxjYWxsZXJBZHJlc3MFAAAACmRyb3BhbW91bnQFAAAABXRva2VuBQAAAANuaWwJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBQAAAAZyZXN1bHQFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAAAjpTt/w==", "height": 1829350, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2AyZ25iTsheeDdqQ3g2X6zrAY7bEAcjyCwjghGcxmAGx Next: BKiUxiX31xrvnKvU4fKkyBxwGt2PdizczEBMmjdAMHpq Diff:
Old | New | Differences | |
---|---|---|---|
56 | 56 | case _ => | |
57 | 57 | airdrop | |
58 | 58 | } | |
59 | - | let received = match getInteger(toBase58String(i.caller.bytes)) { | |
60 | - | case a: Int => | |
61 | - | true | |
62 | - | case _ => | |
63 | - | false | |
64 | - | } | |
59 | + | let received = if ((take(valueOrElse(getStringValue(toBase58String(i.caller.bytes)), ""), 8) == "received")) | |
60 | + | then true | |
61 | + | else false | |
65 | 62 | let isprooved = if (if (if ((trtime > time)) | |
66 | 63 | then true | |
67 | 64 | else (callerAdress != trsender)) | |
71 | 68 | else true | |
72 | 69 | let result = if (trexists) | |
73 | 70 | then if ((trtime > time)) | |
74 | - | then ("out of time range: " + toString(trtime)) | |
71 | + | then ("transaction is out of time range: " + toString(trtime)) | |
75 | 72 | else ("" + (if ((callerAdress != trsender)) | |
76 | - | then (((" incorrect sender: " + toString(callerAdress)) + " / ") + toString(trsender)) | |
73 | + | then ((("it is incorrect sender: " + toString(callerAdress)) + " / ") + toString(trsender)) | |
77 | 74 | else ("" + (if (received) | |
78 | - | then getStringValue( | |
75 | + | then getStringValue(toBase58String(i.caller.bytes)) | |
79 | 76 | else ("" + (if (isprooved) | |
80 | 77 | then ("reseived in " + toString(currenttime)) | |
81 | 78 | else "")))))) | |
82 | 79 | else "cant find transaction" | |
83 | 80 | if (isprooved) | |
84 | 81 | then if ((burnamount > 0)) | |
85 | - | then [ | |
82 | + | then [ScriptTransfer(callerAdress, dropamount, token), StringEntry(toBase58String(i.caller.bytes), result), Burn(token, 999)] | |
86 | 83 | else [IntegerEntry(toBase58String(i.caller.bytes), currenttime), ScriptTransfer(callerAdress, dropamount, token)] | |
87 | - | else [StringEntry( | |
84 | + | else [StringEntry(toBase58String(i.caller.bytes), result)] | |
88 | 85 | } | |
89 | 86 | else throw("Strict value is not equal to itself.") | |
90 | 87 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let token = base58'GZc7eKnq2KJwqetRmUzSqr2ZaCGseDZufSocz83sUNoo' | |
5 | 5 | ||
6 | 6 | let airdrop = Address(base58'3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV') | |
7 | 7 | ||
8 | 8 | @Callable(i) | |
9 | 9 | func reset () = [DeleteEntry(toBase58String(i.caller.bytes)), IntegerEntry("burningstage", 0)] | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | ||
13 | 13 | @Callable(i) | |
14 | 14 | func call (id58) = { | |
15 | 15 | let currenttime = match blockInfoByHeight(height) { | |
16 | 16 | case block: BlockInfo => | |
17 | 17 | block.timestamp | |
18 | 18 | case _ => | |
19 | 19 | throw("Can't find block") | |
20 | 20 | } | |
21 | 21 | let balance = assetBalance(airdrop, token) | |
22 | 22 | let burnamount = match getInteger("burningstage") { | |
23 | 23 | case a: Int => | |
24 | 24 | if (if ((getIntegerValue("burningstage") == 0)) | |
25 | 25 | then (currenttime > 1639131654752) | |
26 | 26 | else false) | |
27 | 27 | then fraction(balance, 10, 100) | |
28 | 28 | else 0 | |
29 | 29 | case _ => | |
30 | 30 | throw("no burningstage") | |
31 | 31 | } | |
32 | 32 | let dropamount = 100 | |
33 | 33 | let isenough = if ((balance > dropamount)) | |
34 | 34 | then true | |
35 | 35 | else throw("not enough") | |
36 | 36 | if ((isenough == isenough)) | |
37 | 37 | then { | |
38 | 38 | let id = fromBase58String(id58) | |
39 | 39 | let callerAdress = Address(i.caller.bytes) | |
40 | 40 | let time = 1639148135492 | |
41 | 41 | let trexists = match transferTransactionById(id) { | |
42 | 42 | case ttx: TransferTransaction => | |
43 | 43 | true | |
44 | 44 | case _ => | |
45 | 45 | false | |
46 | 46 | } | |
47 | 47 | let trtime = match transferTransactionById(id) { | |
48 | 48 | case ttx: TransferTransaction => | |
49 | 49 | ttx.timestamp | |
50 | 50 | case _ => | |
51 | 51 | 9999999999999 | |
52 | 52 | } | |
53 | 53 | let trsender = match transferTransactionById(id) { | |
54 | 54 | case ttx: TransferTransaction => | |
55 | 55 | ttx.sender | |
56 | 56 | case _ => | |
57 | 57 | airdrop | |
58 | 58 | } | |
59 | - | let received = match getInteger(toBase58String(i.caller.bytes)) { | |
60 | - | case a: Int => | |
61 | - | true | |
62 | - | case _ => | |
63 | - | false | |
64 | - | } | |
59 | + | let received = if ((take(valueOrElse(getStringValue(toBase58String(i.caller.bytes)), ""), 8) == "received")) | |
60 | + | then true | |
61 | + | else false | |
65 | 62 | let isprooved = if (if (if ((trtime > time)) | |
66 | 63 | then true | |
67 | 64 | else (callerAdress != trsender)) | |
68 | 65 | then true | |
69 | 66 | else received) | |
70 | 67 | then false | |
71 | 68 | else true | |
72 | 69 | let result = if (trexists) | |
73 | 70 | then if ((trtime > time)) | |
74 | - | then ("out of time range: " + toString(trtime)) | |
71 | + | then ("transaction is out of time range: " + toString(trtime)) | |
75 | 72 | else ("" + (if ((callerAdress != trsender)) | |
76 | - | then (((" incorrect sender: " + toString(callerAdress)) + " / ") + toString(trsender)) | |
73 | + | then ((("it is incorrect sender: " + toString(callerAdress)) + " / ") + toString(trsender)) | |
77 | 74 | else ("" + (if (received) | |
78 | - | then getStringValue( | |
75 | + | then getStringValue(toBase58String(i.caller.bytes)) | |
79 | 76 | else ("" + (if (isprooved) | |
80 | 77 | then ("reseived in " + toString(currenttime)) | |
81 | 78 | else "")))))) | |
82 | 79 | else "cant find transaction" | |
83 | 80 | if (isprooved) | |
84 | 81 | then if ((burnamount > 0)) | |
85 | - | then [ | |
82 | + | then [ScriptTransfer(callerAdress, dropamount, token), StringEntry(toBase58String(i.caller.bytes), result), Burn(token, 999)] | |
86 | 83 | else [IntegerEntry(toBase58String(i.caller.bytes), currenttime), ScriptTransfer(callerAdress, dropamount, token)] | |
87 | - | else [StringEntry( | |
84 | + | else [StringEntry(toBase58String(i.caller.bytes), result)] | |
88 | 85 | } | |
89 | 86 | else throw("Strict value is not equal to itself.") | |
90 | 87 | } | |
91 | 88 | ||
92 | 89 |
github/deemru/w8io/026f985 29.53 ms ◑