tx · BjDHqU87iuEJGa4xV7Aa55Tm3AdBwfDaApvRzos56D1T 3N5jpkcHiH5R36y9cYnoXhVHe4pxRkS3peF: -0.01400000 Waves 2020.03.11 18:36 [904849] smart account 3N5jpkcHiH5R36y9cYnoXhVHe4pxRkS3peF > SELF 0.00000000 Waves
{ "type": 13, "id": "BjDHqU87iuEJGa4xV7Aa55Tm3AdBwfDaApvRzos56D1T", "fee": 1400000, "feeAssetId": null, "timestamp": 1583951728923, "version": 1, "sender": "3N5jpkcHiH5R36y9cYnoXhVHe4pxRkS3peF", "senderPublicKey": "9v3cUhWaBqFKLuHQTbz2osNsxRANDcpaRZja43mFNkR3", "proofs": [ "tnWeLPTq88xKejddh98ZJNTJrh365MQ6bhiuCAMhFirbMJx8oTsfiY1UzCeSt7hA2Cd6WtCQDDBHKQKaqPtemTz" ], "script": "base64:AAIDAAAAAAAAAA0IARIAEgASABIDCgEBAAAABQAAAAAGRVVDb2luAQAAACDJofoUphCC2vgdQrn0R0tQm4QOreBLRVolNScltI/WUQAAAAAGVVNDb2luAQAAACCWpimiLpI8FZFaHXIW3ZwI74bEgcPecoAv5ODcRcQ7/QAAAAAOb3duZXJQdWJsaWNLZXkBAAAAIIR0OzhzTJc1ozXjp3CfISpQxO2vbrCrTGSiFABFRe8mAAAAAA1PcmFjbGVBZGRyZXNzCQEAAAAHQWRkcmVzcwAAAAEJAAGbAAAAAQIAAAAjM05BY29lV2RVVFduOGNzWEpQRzQ3djFGanRqY2ZxeGI1dHUBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAANT3JhY2xlQWRkcmVzcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAAAAAEAAAAAWkBAAAAB2RlcG9zaXQAAAAABAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF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AAA5vd25lclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgdGCuTK", "chainId": 84, "height": 904849, "spentComplexity": 0 } View: original | compacted Prev: Cm6C884zYJHbW5w1ZC27w9gUgmoRiDek1ribtDxrWDGH Next: kRfpfFMedXH6N1BznxHwbywmbsq6tEdJWdCzEQ8gXbW Diff:
Old | New | Differences | |
---|---|---|---|
56 | 56 | let m = e("waves_usd_2") | |
57 | 57 | let n = ((j.amount * m) / 100) | |
58 | 58 | let o = (l + (j.amount / 100)) | |
59 | - | ScriptResult(WriteSet([DataEntry((k + "_waves"), o)]), TransferSet([ScriptTransfer(i.caller, | |
59 | + | ScriptResult(WriteSet([DataEntry((k + "_waves"), o)]), TransferSet([ScriptTransfer(i.caller, m, a)])) | |
60 | 60 | } | |
61 | 61 | } | |
62 | 62 |
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 = Address(toBytes("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 = e("waves_usd_2") | |
57 | 57 | let n = ((j.amount * m) / 100) | |
58 | 58 | let o = (l + (j.amount / 100)) | |
59 | - | ScriptResult(WriteSet([DataEntry((k + "_waves"), o)]), TransferSet([ScriptTransfer(i.caller, | |
59 | + | ScriptResult(WriteSet([DataEntry((k + "_waves"), o)]), TransferSet([ScriptTransfer(i.caller, m, a)])) | |
60 | 60 | } | |
61 | 61 | } | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | ||
65 | 65 | @Callable(i) | |
66 | 66 | func withdrawUSCoin () = { | |
67 | 67 | let j = extract(i.payment) | |
68 | 68 | if (isDefined(j.assetId)) | |
69 | 69 | then if ((j.assetId == a)) | |
70 | 70 | then { | |
71 | 71 | let k = toBase58String(i.caller.bytes) | |
72 | 72 | let l = { | |
73 | 73 | let g = getInteger(this, (k + "_uscoin")) | |
74 | 74 | if ($isInstanceOf(g, "Int")) | |
75 | 75 | then { | |
76 | 76 | let h = g | |
77 | 77 | h | |
78 | 78 | } | |
79 | 79 | else 0 | |
80 | 80 | } | |
81 | 81 | let m = e("waves_usd_2") | |
82 | 82 | let n = (j.amount / 100) | |
83 | 83 | let o = (l - n) | |
84 | 84 | if ((0 > j.amount)) | |
85 | 85 | then throw("Can't withdraw negative amount") | |
86 | 86 | else if ((0 > o)) | |
87 | 87 | then throw("Not enough USCoin Deposited") | |
88 | 88 | else ScriptResult(WriteSet([DataEntry((k + "_uscoin"), o)]), TransferSet([ScriptTransfer(i.caller, n, b)])) | |
89 | 89 | } | |
90 | 90 | else throw("You Can Withdraw with EUCoin only") | |
91 | 91 | else throw("You Can Withdraw with EUCoin only") | |
92 | 92 | } | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | ||
96 | 96 | @Callable(i) | |
97 | 97 | func withdrawWaves () = { | |
98 | 98 | let j = extract(i.payment) | |
99 | 99 | if (isDefined(j.assetId)) | |
100 | 100 | then if ((j.assetId == a)) | |
101 | 101 | then { | |
102 | 102 | let k = toBase58String(i.caller.bytes) | |
103 | 103 | let l = { | |
104 | 104 | let g = getInteger(this, (k + "_waves")) | |
105 | 105 | if ($isInstanceOf(g, "Int")) | |
106 | 106 | then { | |
107 | 107 | let h = g | |
108 | 108 | h | |
109 | 109 | } | |
110 | 110 | else 0 | |
111 | 111 | } | |
112 | 112 | let m = e("waves_usd_2") | |
113 | 113 | let n = ((j.amount / m) * 100) | |
114 | 114 | let o = (l - n) | |
115 | 115 | if ((0 > j.amount)) | |
116 | 116 | then throw("Can't withdraw negative amount") | |
117 | 117 | else if ((0 > o)) | |
118 | 118 | then throw("Not enough Waves Deposited") | |
119 | 119 | else ScriptResult(WriteSet([DataEntry((k + "_waves"), o)]), TransferSet([ScriptTransfer(i.caller, n, unit)])) | |
120 | 120 | } | |
121 | 121 | else throw("You Can Withdraw with EUCoin only") | |
122 | 122 | else throw("You Can Withdraw with EUCoin only") | |
123 | 123 | } | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | ||
127 | 127 | @Callable(i) | |
128 | 128 | func getFaucet (p) = { | |
129 | 129 | let k = toBase58String(i.caller.bytes) | |
130 | 130 | let l = { | |
131 | 131 | let g = getInteger(this, (k + "_faucet")) | |
132 | 132 | if ($isInstanceOf(g, "Int")) | |
133 | 133 | then { | |
134 | 134 | let h = g | |
135 | 135 | h | |
136 | 136 | } | |
137 | 137 | else 0 | |
138 | 138 | } | |
139 | 139 | if ((0 > p)) | |
140 | 140 | then throw("Can't withdraw negative amount") | |
141 | 141 | else if ((l > 0)) | |
142 | 142 | then throw("Faucet already taken") | |
143 | 143 | else ScriptResult(WriteSet([DataEntry((k + "_faucet"), p)]), TransferSet([ScriptTransfer(i.caller, p, a)])) | |
144 | 144 | } | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | @Verifier(q) | |
148 | 148 | func r () = { | |
149 | 149 | let g = q | |
150 | 150 | if ($isInstanceOf(g, "SetScriptTransaction")) | |
151 | 151 | then { | |
152 | 152 | let s = g | |
153 | 153 | sigVerify(q.bodyBytes, q.proofs[0], c) | |
154 | 154 | } | |
155 | 155 | else if ($isInstanceOf(g, "DataTransaction")) | |
156 | 156 | then { | |
157 | 157 | let s = g | |
158 | 158 | true | |
159 | 159 | } | |
160 | 160 | else false | |
161 | 161 | } | |
162 | 162 |
github/deemru/w8io/169f3d6 30.88 ms ◑