tx · CRgEhBx6X9Xj48xbX4FuiFcPMPfpgiz9RtGRYZNmRELY 3MscxufrKTYtkCUxbyHWWyRY8mbbgRm7SAt: -0.01000000 Waves 2019.09.07 15:38 [665658] smart account 3MscxufrKTYtkCUxbyHWWyRY8mbbgRm7SAt > SELF 0.00000000 Waves
{ "type": 13, "id": "CRgEhBx6X9Xj48xbX4FuiFcPMPfpgiz9RtGRYZNmRELY", "fee": 1000000, "feeAssetId": null, "timestamp": 1567859731326, "version": 1, "sender": "3MscxufrKTYtkCUxbyHWWyRY8mbbgRm7SAt", "senderPublicKey": "J1Ko4HkNuFQ4fzuGBhLLQ726mwGkmEinhYHrN9VX5t41", "proofs": [ "2md8fJwUPaWfrhoAkX1zphWsLEgus3PBjQvvN4DbmUuFBHdJqWghwjdYVcbWBvRTvzqzx82Vo69S4fsmziULTWzj" ], "script": "base64:AAIDAAAAAAAAAAAAAAAAAAAABAAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAIWNhbiBob2RsIHdhdmVzIG9ubHkgYXQgdGhlIG1vbWVudAQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAABJ4eHhJbnZlc3RvckJhbGFuY2UJAAEsAAAAAgkAASwAAAACBQAAAApjdXJyZW50S2V5AgAAAAFfAgAAAAJpYgQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAABJ4eHhJbnZlc3RvckJhbGFuY2UDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAAJbmV3QW1vdW50CQAAZAAAAAIFAAAADWN1cnJlbnRBbW91bnQI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XRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAAAQAAACAOG3x9G+NPWhjnhgPt5jQyo6kTNMUApxsG0dvTDxrODwftr1eN", "chainId": 84, "height": 665658, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | ||
5 | + | ||
6 | + | @Callable(a) | |
7 | + | func deposit () = { | |
8 | + | let b = extract(a.payment) | |
9 | + | if (isDefined(b.assetId)) | |
10 | + | then throw("can hodl waves only at the moment") | |
11 | + | else { | |
12 | + | let c = toBase58String(a.caller.bytes) | |
13 | + | let d = ((c + "_") + "ib") | |
14 | + | let e = { | |
15 | + | let f = getInteger(this, d) | |
16 | + | if ($isInstanceOf(f, "Int")) | |
17 | + | then { | |
18 | + | let g = f | |
19 | + | g | |
20 | + | } | |
21 | + | else 0 | |
22 | + | } | |
23 | + | let h = (e + b.amount) | |
24 | + | WriteSet([DataEntry(d, h)]) | |
25 | + | } | |
26 | + | } | |
27 | + | ||
28 | + | ||
29 | + | ||
30 | + | @Callable(a) | |
31 | + | func withdraw (i) = { | |
32 | + | let c = toBase58String(a.caller.bytes) | |
33 | + | let d = ((c + "_") + "ib") | |
34 | + | let e = { | |
35 | + | let f = getInteger(this, d) | |
36 | + | if ($isInstanceOf(f, "Int")) | |
37 | + | then { | |
38 | + | let g = f | |
39 | + | g | |
40 | + | } | |
41 | + | else 0 | |
42 | + | } | |
43 | + | let h = (e - i) | |
44 | + | if ((0 > i)) | |
45 | + | then throw("Can't withdraw negative amount") | |
46 | + | else if ((0 > h)) | |
47 | + | then throw("Not enough balance") | |
48 | + | else ScriptResult(WriteSet([DataEntry(d, h)]), TransferSet([ScriptTransfer(a.caller, i, unit)])) | |
49 | + | } | |
50 | + | ||
51 | + | ||
52 | + | ||
53 | + | @Callable(a) | |
54 | + | func getFunds (i) = { | |
55 | + | let j = 2 | |
56 | + | let c = toBase58String(a.caller.bytes) | |
57 | + | let k = ((c + "_") + "sf") | |
58 | + | let l = ((c + "_") + "sv") | |
59 | + | let e = { | |
60 | + | let f = getInteger(this, k) | |
61 | + | if ($isInstanceOf(f, "Int")) | |
62 | + | then { | |
63 | + | let g = f | |
64 | + | g | |
65 | + | } | |
66 | + | else 0 | |
67 | + | } | |
68 | + | let m = { | |
69 | + | let f = getInteger(this, l) | |
70 | + | if ($isInstanceOf(f, "Int")) | |
71 | + | then { | |
72 | + | let g = f | |
73 | + | g | |
74 | + | } | |
75 | + | else 0 | |
76 | + | } | |
77 | + | let h = (e - i) | |
78 | + | if ((0 > i)) | |
79 | + | then throw("Can't withdraw negative amount") | |
80 | + | else if ((0 > h)) | |
81 | + | then throw("Not enough balance") | |
82 | + | else if ((j > m)) | |
83 | + | then throw("Not enough votes. At least 2 votes required!") | |
84 | + | else ScriptResult(WriteSet([DataEntry(k, h)]), TransferSet([ScriptTransfer(a.caller, i, unit)])) | |
85 | + | } | |
86 | + | ||
87 | + | ||
88 | + | ||
89 | + | @Callable(a) | |
90 | + | func vote (i,n) = { | |
91 | + | let c = toBase58String(a.caller.bytes) | |
92 | + | let d = ((c + "_") + "ib") | |
93 | + | let k = ((n + "_") + "sf") | |
94 | + | let l = ((n + "_") + "sv") | |
95 | + | let o = ((n + "_") + c) | |
96 | + | let p = { | |
97 | + | let f = getInteger(this, o) | |
98 | + | if ($isInstanceOf(f, "Int")) | |
99 | + | then { | |
100 | + | let g = f | |
101 | + | g | |
102 | + | } | |
103 | + | else 0 | |
104 | + | } | |
105 | + | let e = { | |
106 | + | let f = getInteger(this, d) | |
107 | + | if ($isInstanceOf(f, "Int")) | |
108 | + | then { | |
109 | + | let g = f | |
110 | + | g | |
111 | + | } | |
112 | + | else 0 | |
113 | + | } | |
114 | + | let q = { | |
115 | + | let f = getInteger(this, l) | |
116 | + | if ($isInstanceOf(f, "Int")) | |
117 | + | then { | |
118 | + | let g = f | |
119 | + | g | |
120 | + | } | |
121 | + | else 0 | |
122 | + | } | |
123 | + | let r = { | |
124 | + | let f = getInteger(this, k) | |
125 | + | if ($isInstanceOf(f, "Int")) | |
126 | + | then { | |
127 | + | let g = f | |
128 | + | g | |
129 | + | } | |
130 | + | else 0 | |
131 | + | } | |
132 | + | if ((0 >= i)) | |
133 | + | then throw("Can't withdraw negative amount") | |
134 | + | else if ((i > e)) | |
135 | + | then throw("Not enough balance!") | |
136 | + | else if ((p > 0)) | |
137 | + | then throw("Only one vote per project is possible!") | |
138 | + | else WriteSet([DataEntry(d, (e - i)), DataEntry(l, (q + 1)), DataEntry(o, 1), DataEntry(k, (r + i))]) | |
139 | + | } | |
140 | + | ||
141 | + | ||
142 | + | @Verifier(s) | |
143 | + | func t () = { | |
144 | + | let f = s | |
145 | + | if ($isInstanceOf(f, "SetScriptTransaction")) | |
146 | + | then { | |
147 | + | let u = f | |
148 | + | sigVerify(s.bodyBytes, s.proofs[0], base58'x51ySWMyhE8G2AqJqmDpe3qoQM2aBwmieiJzZLK33JW') | |
149 | + | } | |
150 | + | else false | |
151 | + | } | |
152 | + |
github/deemru/w8io/169f3d6 22.87 ms ◑