tx · Ds97igpf2vjYHsWmMmgG3QUU5FWDbV535fbeFYDNareb 3N5jpkcHiH5R36y9cYnoXhVHe4pxRkS3peF: -0.01400000 Waves 2020.03.11 22:29 [904908] smart account 3N5jpkcHiH5R36y9cYnoXhVHe4pxRkS3peF > SELF 0.00000000 Waves
{ "type": 13, "id": "Ds97igpf2vjYHsWmMmgG3QUU5FWDbV535fbeFYDNareb", "fee": 1400000, "feeAssetId": null, "timestamp": 1583955004907, "version": 1, "sender": "3N5jpkcHiH5R36y9cYnoXhVHe4pxRkS3peF", "senderPublicKey": "9v3cUhWaBqFKLuHQTbz2osNsxRANDcpaRZja43mFNkR3", "proofs": [ "3H3qAy4ZR2c96i1uEbuB15P4sov2bJ6KtBuKBbz5jgUm1yK2q59eaKJ6E4Ens4x7rBVmYvC5cjv9k376Rfx4YHZd" ], "script": "base64:AAIDAAAAAAAAAA0IARIAEgASABIDCgEBAAAABQAAAAAGRVVDb2luAQAAACDJofoUphCC2vgdQrn0R0tQm4QOreBLRVolNScltI/WUQAAAAAGVVNDb2luAQAAACCWpimiLpI8FZFaHXIW3ZwI74bEgcPecoAv5ODcRcQ7/QAAAAAOb3duZXJQdWJsaWNLZXkBAAAAIIR0OzhzTJc1ozXjp3CfISpQxO2vbrCrTGSiFABFRe8mAAAAAA1PcmFjbGVBZGRyZXNzCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAECAAAAIzNOQWNvZVdkVVRXbjhjc1hKUEc0N3YxRmp0amNmcXhiNXR1AQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAADU9yYWNsZUFkZHJlc3MFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAAAABAAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAA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AAFkBQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAOb3duZXJQdWJsaWNLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYHTZ4D+A==", "chainId": 84, "height": 904908, "spentComplexity": 0 } View: original | compacted Prev: J2LFZQFo4NpoFCeTywdJhGgUrnsFzagT1s7pmQD7jFT9 Next: GFf3SRaMSzZbgvHeTgWQc3eiTy78WnhDvuzqtRGd5wn6 Diff:
Old | New | Differences | |
---|---|---|---|
65 | 65 | if ((m == 0)) | |
66 | 66 | then throw("rate 0") | |
67 | 67 | else { | |
68 | - | let n = j.amount | |
68 | + | let n = (j.amount * m) | |
69 | 69 | let o = (l + j.amount) | |
70 | 70 | ScriptResult(WriteSet([DataEntry((k + "_waves"), o)]), TransferSet([ScriptTransfer(i.caller, n, a)])) | |
71 | 71 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'Ea6CdDfumo8ZFecxUSWKAjZpQXmkRC79WB4ktu3KffPn' | |
5 | 5 | ||
6 | 6 | let b = base58'B957NA5BEM8quCDhe1fUPkqBSdCZdJunNxjGE8FRJkWx' | |
7 | 7 | ||
8 | 8 | let c = base58'9v3cUhWaBqFKLuHQTbz2osNsxRANDcpaRZja43mFNkR3' | |
9 | 9 | ||
10 | 10 | let d = addressFromStringValue("3NAcoeWdUTWn8csXJPG47v1Fjtjcfqxb5tu") | |
11 | 11 | ||
12 | 12 | func e (f) = { | |
13 | 13 | let g = getInteger(d, f) | |
14 | 14 | if ($isInstanceOf(g, "Int")) | |
15 | 15 | then { | |
16 | 16 | let h = g | |
17 | 17 | h | |
18 | 18 | } | |
19 | 19 | else 0 | |
20 | 20 | } | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | @Callable(i) | |
24 | 24 | func deposit () = { | |
25 | 25 | let j = extract(i.payment) | |
26 | 26 | if (isDefined(j.assetId)) | |
27 | 27 | then if ((j.assetId == b)) | |
28 | 28 | then { | |
29 | 29 | let k = toBase58String(i.caller.bytes) | |
30 | 30 | let l = { | |
31 | 31 | let g = getInteger(this, (k + "_uscoin")) | |
32 | 32 | if ($isInstanceOf(g, "Int")) | |
33 | 33 | then { | |
34 | 34 | let h = g | |
35 | 35 | h | |
36 | 36 | } | |
37 | 37 | else 0 | |
38 | 38 | } | |
39 | 39 | let m = e("waves_usd_2") | |
40 | 40 | let n = (j.amount * 100) | |
41 | 41 | let o = (l + j.amount) | |
42 | 42 | ScriptResult(WriteSet([DataEntry((k + "_uscoin"), o)]), TransferSet([ScriptTransfer(i.caller, n, a)])) | |
43 | 43 | } | |
44 | 44 | else throw("can hodl USCoin only at the moment") | |
45 | 45 | else { | |
46 | 46 | let k = toBase58String(i.caller.bytes) | |
47 | 47 | let l = { | |
48 | 48 | let g = getInteger(this, (k + "_waves")) | |
49 | 49 | if ($isInstanceOf(g, "Int")) | |
50 | 50 | then { | |
51 | 51 | let h = g | |
52 | 52 | h | |
53 | 53 | } | |
54 | 54 | else 0 | |
55 | 55 | } | |
56 | 56 | let m = { | |
57 | 57 | let g = getInteger(d, "waves_usd_2") | |
58 | 58 | if ($isInstanceOf(g, "Int")) | |
59 | 59 | then { | |
60 | 60 | let h = g | |
61 | 61 | h | |
62 | 62 | } | |
63 | 63 | else 0 | |
64 | 64 | } | |
65 | 65 | if ((m == 0)) | |
66 | 66 | then throw("rate 0") | |
67 | 67 | else { | |
68 | - | let n = j.amount | |
68 | + | let n = (j.amount * m) | |
69 | 69 | let o = (l + j.amount) | |
70 | 70 | ScriptResult(WriteSet([DataEntry((k + "_waves"), o)]), TransferSet([ScriptTransfer(i.caller, n, a)])) | |
71 | 71 | } | |
72 | 72 | } | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | ||
77 | 77 | @Callable(i) | |
78 | 78 | func withdrawUSCoin () = { | |
79 | 79 | let j = extract(i.payment) | |
80 | 80 | if (isDefined(j.assetId)) | |
81 | 81 | then if ((j.assetId == a)) | |
82 | 82 | then { | |
83 | 83 | let k = toBase58String(i.caller.bytes) | |
84 | 84 | let l = { | |
85 | 85 | let g = getInteger(this, (k + "_uscoin")) | |
86 | 86 | if ($isInstanceOf(g, "Int")) | |
87 | 87 | then { | |
88 | 88 | let h = g | |
89 | 89 | h | |
90 | 90 | } | |
91 | 91 | else 0 | |
92 | 92 | } | |
93 | 93 | let m = e("waves_usd_2") | |
94 | 94 | let n = (j.amount / 100) | |
95 | 95 | let o = (l - n) | |
96 | 96 | if ((0 > j.amount)) | |
97 | 97 | then throw("Can't withdraw negative amount") | |
98 | 98 | else if ((0 > o)) | |
99 | 99 | then throw("Not enough USCoin Deposited") | |
100 | 100 | else ScriptResult(WriteSet([DataEntry((k + "_uscoin"), o)]), TransferSet([ScriptTransfer(i.caller, n, b)])) | |
101 | 101 | } | |
102 | 102 | else throw("You Can Withdraw with EUCoin only") | |
103 | 103 | else throw("You Can Withdraw with EUCoin only") | |
104 | 104 | } | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | ||
108 | 108 | @Callable(i) | |
109 | 109 | func withdrawWaves () = { | |
110 | 110 | let j = extract(i.payment) | |
111 | 111 | if (isDefined(j.assetId)) | |
112 | 112 | then if ((j.assetId == a)) | |
113 | 113 | then { | |
114 | 114 | let k = toBase58String(i.caller.bytes) | |
115 | 115 | let l = { | |
116 | 116 | let g = getInteger(this, (k + "_waves")) | |
117 | 117 | if ($isInstanceOf(g, "Int")) | |
118 | 118 | then { | |
119 | 119 | let h = g | |
120 | 120 | h | |
121 | 121 | } | |
122 | 122 | else 0 | |
123 | 123 | } | |
124 | 124 | let m = e("waves_usd_2") | |
125 | 125 | let n = j.amount | |
126 | 126 | let o = (l - n) | |
127 | 127 | if ((0 > j.amount)) | |
128 | 128 | then throw("Can't withdraw negative amount") | |
129 | 129 | else if ((0 > o)) | |
130 | 130 | then throw("Not enough Waves Deposited") | |
131 | 131 | else ScriptResult(WriteSet([DataEntry((k + "_waves"), o)]), TransferSet([ScriptTransfer(i.caller, n, unit)])) | |
132 | 132 | } | |
133 | 133 | else throw("You Can Withdraw with EUCoin only") | |
134 | 134 | else throw("You Can Withdraw with EUCoin only") | |
135 | 135 | } | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | ||
139 | 139 | @Callable(i) | |
140 | 140 | func getFaucet (p) = { | |
141 | 141 | let k = toBase58String(i.caller.bytes) | |
142 | 142 | let l = { | |
143 | 143 | let g = getInteger(this, (k + "_faucet")) | |
144 | 144 | if ($isInstanceOf(g, "Int")) | |
145 | 145 | then { | |
146 | 146 | let h = g | |
147 | 147 | h | |
148 | 148 | } | |
149 | 149 | else 0 | |
150 | 150 | } | |
151 | 151 | if ((0 > p)) | |
152 | 152 | then throw("Can't withdraw negative amount") | |
153 | 153 | else if ((l > 0)) | |
154 | 154 | then throw("Faucet already taken") | |
155 | 155 | else ScriptResult(WriteSet([DataEntry((k + "_faucet"), p)]), TransferSet([ScriptTransfer(i.caller, p, a)])) | |
156 | 156 | } | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | @Verifier(q) | |
160 | 160 | func r () = { | |
161 | 161 | let g = q | |
162 | 162 | if ($isInstanceOf(g, "SetScriptTransaction")) | |
163 | 163 | then { | |
164 | 164 | let s = g | |
165 | 165 | sigVerify(q.bodyBytes, q.proofs[0], c) | |
166 | 166 | } | |
167 | 167 | else if ($isInstanceOf(g, "DataTransaction")) | |
168 | 168 | then { | |
169 | 169 | let s = g | |
170 | 170 | true | |
171 | 171 | } | |
172 | 172 | else false | |
173 | 173 | } | |
174 | 174 |
github/deemru/w8io/169f3d6 43.33 ms ◑