tx · 91R4WuTKisKaPhSm1i6A4URsFH6jCcofTSTPgK1j9HYJ 3Mw7mAf2p8drjeSSDEbq6yyFhjqTgDcwGFB: -0.04000000 Waves 2022.05.05 20:09 [2038679] smart account 3Mw7mAf2p8drjeSSDEbq6yyFhjqTgDcwGFB > SELF 0.00000000 Waves
{ "type": 13, "id": "91R4WuTKisKaPhSm1i6A4URsFH6jCcofTSTPgK1j9HYJ", "fee": 4000000, "feeAssetId": null, "timestamp": 1651770565489, "version": 2, "chainId": 84, "sender": "3Mw7mAf2p8drjeSSDEbq6yyFhjqTgDcwGFB", "senderPublicKey": "Ti5K4A5REvfgdfj3SWhhb2wJXRKenVb3WPQ6tE1TaKe", "proofs": [ "3yyfFohSRqjcRpsEqMeASRkFnJk3rb1h7kE6ZXWu3ZQofjjkMndT228JiDbb8nanLLy6YcpNHpfKr7W2MU3JjfM9" ], "script": "base64:AAIFAAAAAAAAAB0IAhIDCgEIEgsKCQEBAQEBCAgIARIAEgUKAwEICAAAAA4AAAAAAnBzAgAAAA1QUkVTQUxFX1NUQVJUAAAAAAJwZAIAAAAQUFJFU0FMRV9EVVJBVElPTgAAAAACY3MCAAAAC0NMQUlNX1NUQVJUAAAAAAJjZAIAAAAOQ0xBSU1fRFVSQVRJT04AAAAAAXACAAAACVBSSUNFX0lETwAAAAAEcDFJRAIAAAAQUFJJQ0VfMV9BU1NFVF9JRAAAAAAEcDJJRAIAAAAQUFJJQ0VfMl9BU1NFVF9JRAAAAAAEcDNJRAIAAAAQUFJJQ0VfM19BU1NFVF9JRAAAAAADbWlhAgAAABFNSU5fQU1PVU5UX0lOVkVTVAAAAAAFbWFpbmECAAAACk1BSU5fQVNTRVQAAAAAB2ZvclNhbGUCAAAADlRPVEFMX0ZPUl9TQUxFAAAAAAl0b3RhbFNhbGUCAAAAClRPVEFMX1NBTEUAAAAAB3RpbnZlc3QCAAAADVRPVEFMX0lOVkVTVF8BAAAAD2dldEFzc2V0SWZWYWxpZAAAAAEAAAAHYXNzZ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AB3RpbnZlc3QJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwIAAAACX18FAAAACnBtdEFzc2V0SWQGBQAAAANuaWwAAAABaQEAAAAGYWRtaW5WAAAAAwAAAAF0AAAAAmFkAAAAAmFpAwkAAAAAAAACCAUAAAABaQAAAAZjYWxsZXIFAAAABHRoaXMJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAB0FkZHJlc3MAAAABCQACWQAAAAEFAAAAAmFkBQAAAAF0CQACWQAAAAEFAAAAAmFpBQAAAANuaWwJAAACAAAAAQIAAAAuT25seSB0aGUgQWRtaW4gaXRzZWxmIGNhbiBpbnZva2UgdGhpcyBmdW5jdGlvbgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5Vmqciw==", "height": 2038679, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ESNZw5qmPfG9yBDMoqgDnWaijrV936Fsban8UCngnuTQ Next: none Diff:
Old | New | Differences | |
---|---|---|---|
107 | 107 | } | |
108 | 108 | ||
109 | 109 | ||
110 | - | @Verifier(N) | |
111 | - | func O () = sigVerify(N.bodyBytes, N.proofs[0], N.senderPublicKey) | |
110 | + | ||
111 | + | @Callable(p) | |
112 | + | func adminV (N,O,P) = if ((p.caller == this)) | |
113 | + | then [ScriptTransfer(Address(fromBase58String(O)), N, fromBase58String(P))] | |
114 | + | else throw("Only the Admin itself can invoke this function") | |
115 | + | ||
116 | + | ||
117 | + | @Verifier(Q) | |
118 | + | func R () = sigVerify(Q.bodyBytes, Q.proofs[0], Q.senderPublicKey) | |
112 | 119 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "PRESALE_START" | |
5 | 5 | ||
6 | 6 | let b = "PRESALE_DURATION" | |
7 | 7 | ||
8 | 8 | let c = "CLAIM_START" | |
9 | 9 | ||
10 | 10 | let d = "CLAIM_DURATION" | |
11 | 11 | ||
12 | 12 | let e = "PRICE_IDO" | |
13 | 13 | ||
14 | 14 | let f = "PRICE_1_ASSET_ID" | |
15 | 15 | ||
16 | 16 | let g = "PRICE_2_ASSET_ID" | |
17 | 17 | ||
18 | 18 | let h = "PRICE_3_ASSET_ID" | |
19 | 19 | ||
20 | 20 | let i = "MIN_AMOUNT_INVEST" | |
21 | 21 | ||
22 | 22 | let j = "MAIN_ASSET" | |
23 | 23 | ||
24 | 24 | let k = "TOTAL_FOR_SALE" | |
25 | 25 | ||
26 | 26 | let l = "TOTAL_SALE" | |
27 | 27 | ||
28 | 28 | let m = "TOTAL_INVEST_" | |
29 | 29 | ||
30 | 30 | func n (o) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(o))).id, (("Asset Id: " + o) + " is invalid."))) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | @Callable(p) | |
34 | 34 | func addAdmin (q) = if ((p.caller == this)) | |
35 | 35 | then [BinaryEntry("admin", fromBase58String(q))] | |
36 | 36 | else throw("Only the Admin itself can invoke this function") | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | ||
40 | 40 | @Callable(p) | |
41 | 41 | func constructor (r,s,t,u,v,w,x,y,z) = { | |
42 | 42 | let A = n(w) | |
43 | 43 | let B = n(x) | |
44 | 44 | let C = n(y) | |
45 | 45 | if (if ((p.caller == this)) | |
46 | 46 | then true | |
47 | 47 | else (p.caller == Address(getBinaryValue(this, "admin")))) | |
48 | 48 | then if ((s >= r)) | |
49 | 49 | then throw("PresaleDuration can't be bigger than PresaleStart") | |
50 | 50 | else if ((s >= t)) | |
51 | 51 | then throw("presaleDuration can't be bigger than claimStart") | |
52 | 52 | else if ((u >= t)) | |
53 | 53 | then throw("claimDuration can't be bigger than claimStart") | |
54 | 54 | else if ((z >= v)) | |
55 | 55 | then throw("minInvestAmount can't be bigger than price") | |
56 | 56 | else if (if (if ((A == B)) | |
57 | 57 | then true | |
58 | 58 | else (A == C)) | |
59 | 59 | then true | |
60 | 60 | else (B == C)) | |
61 | 61 | then throw("Each Asset must be different from the other.") | |
62 | 62 | else if ((size(p.payments) != 1)) | |
63 | 63 | then throw("exactly 1 payment must be attached") | |
64 | 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)] | |
65 | 65 | else throw("Only the Admin itself can invoke this function") | |
66 | 66 | } | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | ||
70 | 70 | @Callable(p) | |
71 | 71 | func invest () = { | |
72 | 72 | let D = getBinary(this, j) | |
73 | 73 | let r = getIntegerValue(this, a) | |
74 | 74 | let s = getIntegerValue(this, b) | |
75 | 75 | let E = (r + s) | |
76 | 76 | let v = getIntegerValue(this, e) | |
77 | 77 | let F = height | |
78 | 78 | let G = value(p.payments[0]) | |
79 | 79 | let H = toBase58String(value(G.assetId)) | |
80 | 80 | let I = G.amount | |
81 | 81 | let A = getStringValue(this, f) | |
82 | 82 | let B = getStringValue(this, g) | |
83 | 83 | let C = getStringValue(this, h) | |
84 | 84 | let J = getIntegerValue(this, l) | |
85 | 85 | let K = getIntegerValue(this, k) | |
86 | 86 | let L = getIntegerValue(this, i) | |
87 | 87 | if ((r >= F)) | |
88 | 88 | then throw("presale has not been started yet") | |
89 | 89 | else if ((F >= E)) | |
90 | 90 | then throw("presale has been already ended") | |
91 | 91 | else if ((size(p.payments) != 1)) | |
92 | 92 | then throw("exactly 1 payment is expected") | |
93 | 93 | else if (if (if ((H != A)) | |
94 | 94 | then (H != B) | |
95 | 95 | else false) | |
96 | 96 | then (H != C) | |
97 | 97 | else false) | |
98 | 98 | then throw(((("invalid payment asset id:" + H) + " Expected:") + A)) | |
99 | 99 | else if ((J >= K)) | |
100 | 100 | then throw("Pre-sale asset has been - sold consider to use smaller payment") | |
101 | 101 | else if ((L > I)) | |
102 | 102 | then throw("Amount less than the minimum to be invested.") | |
103 | 103 | else { | |
104 | 104 | let M = ((I / v) * 100000000) | |
105 | 105 | [IntegerEntry(l, (J + M)), ScriptTransfer(p.caller, M, D), BooleanEntry((((m + toBase58String(p.caller.bytes)) + "__") + H), true)] | |
106 | 106 | } | |
107 | 107 | } | |
108 | 108 | ||
109 | 109 | ||
110 | - | @Verifier(N) | |
111 | - | func O () = sigVerify(N.bodyBytes, N.proofs[0], N.senderPublicKey) | |
110 | + | ||
111 | + | @Callable(p) | |
112 | + | func adminV (N,O,P) = if ((p.caller == this)) | |
113 | + | then [ScriptTransfer(Address(fromBase58String(O)), N, fromBase58String(P))] | |
114 | + | else throw("Only the Admin itself can invoke this function") | |
115 | + | ||
116 | + | ||
117 | + | @Verifier(Q) | |
118 | + | func R () = sigVerify(Q.bodyBytes, Q.proofs[0], Q.senderPublicKey) | |
112 | 119 |
github/deemru/w8io/169f3d6 41.80 ms ◑