tx · 8g6cLM8gBeo4CTSUvYNAiDwxFh1SodqncDLQNhyKKsjD 3N5jpkcHiH5R36y9cYnoXhVHe4pxRkS3peF: -0.01400000 Waves 2020.03.10 03:02 [902288] smart account 3N5jpkcHiH5R36y9cYnoXhVHe4pxRkS3peF > SELF 0.00000000 Waves
{ "type": 13, "id": "8g6cLM8gBeo4CTSUvYNAiDwxFh1SodqncDLQNhyKKsjD", "fee": 1400000, "feeAssetId": null, "timestamp": 1583798524284, "version": 1, "sender": "3N5jpkcHiH5R36y9cYnoXhVHe4pxRkS3peF", "senderPublicKey": "9v3cUhWaBqFKLuHQTbz2osNsxRANDcpaRZja43mFNkR3", "proofs": [ "322AxzisuuEz9BnStpRSm8xV6mraUYoNyWqmbBq55WXe29CrH8hA4NVVVVRsbNggNPQCFt6L1zacpyn6zJE2b77U" ], "script": "base64:AAIDAAAAAAAAAA0IARIAEgASABIDCgEBAAAAAwAAAAAGRVVDb2luAQAAACDJofoUphCC2vgdQrn0R0tQm4QOreBLRVolNScltI/WUQAAAAAGVVNDb2luAQAAACCWpimiLpI8FZFaHXIW3ZwI74bEgcPecoAv5ODcRcQ7/QAAAAAOb3duZXJQdWJsaWNLZXkBAAAAIIR0OzhzTJc1ozXjp3CfISpQxO2vbrCrTGSiFABFRe8mAAAABAAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkAwkAAAAAAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAABlVTQ29pbgQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMJAAEsAAAAAgUAAAAKY3VycmVudEtleQIAAAAHX3VzY29pbgMJAAABAAAA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AAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA5vd25lclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgeMfdyW", "chainId": 84, "height": 902288, "spentComplexity": 0 } View: original | compacted Prev: CQZ5DUYy7TYDzQWinGESEPHpUKHiBRoAuMFmzYwzTv8L Next: A6A9x5vkBwtWGJH4chRb8GTtoLHeFDKzLDFB6SFoA2wr Diff:
Old | New | Differences | |
---|---|---|---|
104 | 104 | ||
105 | 105 | ||
106 | 106 | @Callable(d) | |
107 | - | func getFaucet (k) = if ((0 > k)) | |
108 | - | then throw("Can't withdraw negative amount") | |
109 | - | else TransferSet([ScriptTransfer(d.caller, k, a)]) | |
107 | + | func getFaucet (k) = { | |
108 | + | let f = toBase58String(d.caller.bytes) | |
109 | + | let g = { | |
110 | + | let h = getInteger(this, (f + "_faucet")) | |
111 | + | if ($isInstanceOf(h, "Int")) | |
112 | + | then { | |
113 | + | let i = h | |
114 | + | i | |
115 | + | } | |
116 | + | else 0 | |
117 | + | } | |
118 | + | if ((0 > k)) | |
119 | + | then throw("Can't withdraw negative amount") | |
120 | + | else if ((g > 0)) | |
121 | + | then throw("Faucet already taken") | |
122 | + | else ScriptResult(WriteSet([DataEntry((f + "_faucet"), k)]), TransferSet([ScriptTransfer(d.caller, k, a)])) | |
123 | + | } | |
110 | 124 | ||
111 | 125 | ||
112 | 126 | @Verifier(l) |
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 | @Callable(d) | |
11 | 11 | func deposit () = { | |
12 | 12 | let e = extract(d.payment) | |
13 | 13 | if (isDefined(e.assetId)) | |
14 | 14 | then if ((e.assetId == b)) | |
15 | 15 | then { | |
16 | 16 | let f = toBase58String(d.caller.bytes) | |
17 | 17 | let g = { | |
18 | 18 | let h = getInteger(this, (f + "_uscoin")) | |
19 | 19 | if ($isInstanceOf(h, "Int")) | |
20 | 20 | then { | |
21 | 21 | let i = h | |
22 | 22 | i | |
23 | 23 | } | |
24 | 24 | else 0 | |
25 | 25 | } | |
26 | 26 | let j = (g + e.amount) | |
27 | 27 | ScriptResult(WriteSet([DataEntry((f + "_uscoin"), j)]), TransferSet([ScriptTransfer(d.caller, e.amount, a)])) | |
28 | 28 | } | |
29 | 29 | else throw("can hodl USCoin only at the moment") | |
30 | 30 | else { | |
31 | 31 | let f = toBase58String(d.caller.bytes) | |
32 | 32 | let g = { | |
33 | 33 | let h = getInteger(this, (f + "_waves")) | |
34 | 34 | if ($isInstanceOf(h, "Int")) | |
35 | 35 | then { | |
36 | 36 | let i = h | |
37 | 37 | i | |
38 | 38 | } | |
39 | 39 | else 0 | |
40 | 40 | } | |
41 | 41 | let j = (g + (e.amount / 100)) | |
42 | 42 | ScriptResult(WriteSet([DataEntry((f + "_waves"), j)]), TransferSet([ScriptTransfer(d.caller, (e.amount / 100), a)])) | |
43 | 43 | } | |
44 | 44 | } | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | ||
48 | 48 | @Callable(d) | |
49 | 49 | func withdrawUSCoin () = { | |
50 | 50 | let e = extract(d.payment) | |
51 | 51 | if (isDefined(e.assetId)) | |
52 | 52 | then if ((e.assetId == a)) | |
53 | 53 | then { | |
54 | 54 | let f = toBase58String(d.caller.bytes) | |
55 | 55 | let g = { | |
56 | 56 | let h = getInteger(this, (f + "_uscoin")) | |
57 | 57 | if ($isInstanceOf(h, "Int")) | |
58 | 58 | then { | |
59 | 59 | let i = h | |
60 | 60 | i | |
61 | 61 | } | |
62 | 62 | else 0 | |
63 | 63 | } | |
64 | 64 | let j = (g - e.amount) | |
65 | 65 | if ((0 > e.amount)) | |
66 | 66 | then throw("Can't withdraw negative amount") | |
67 | 67 | else if ((0 > j)) | |
68 | 68 | then throw("Not enough USCoin Deposited") | |
69 | 69 | else ScriptResult(WriteSet([DataEntry((f + "_uscoin"), j)]), TransferSet([ScriptTransfer(d.caller, e.amount, b)])) | |
70 | 70 | } | |
71 | 71 | else throw("You Can Withdraw with EUCoin only") | |
72 | 72 | else throw("You Can Withdraw with EUCoin only") | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | ||
77 | 77 | @Callable(d) | |
78 | 78 | func withdrawWaves () = { | |
79 | 79 | let e = extract(d.payment) | |
80 | 80 | if (isDefined(e.assetId)) | |
81 | 81 | then if ((e.assetId == a)) | |
82 | 82 | then { | |
83 | 83 | let f = toBase58String(d.caller.bytes) | |
84 | 84 | let g = { | |
85 | 85 | let h = getInteger(this, (f + "_waves")) | |
86 | 86 | if ($isInstanceOf(h, "Int")) | |
87 | 87 | then { | |
88 | 88 | let i = h | |
89 | 89 | i | |
90 | 90 | } | |
91 | 91 | else 0 | |
92 | 92 | } | |
93 | 93 | let j = (g - e.amount) | |
94 | 94 | if ((0 > e.amount)) | |
95 | 95 | then throw("Can't withdraw negative amount") | |
96 | 96 | else if ((0 > j)) | |
97 | 97 | then throw("Not enough Waves Deposited") | |
98 | 98 | else ScriptResult(WriteSet([DataEntry((f + "_waves"), j)]), TransferSet([ScriptTransfer(d.caller, (e.amount * 100), unit)])) | |
99 | 99 | } | |
100 | 100 | else throw("You Can Withdraw with EUCoin only") | |
101 | 101 | else throw("You Can Withdraw with EUCoin only") | |
102 | 102 | } | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | ||
106 | 106 | @Callable(d) | |
107 | - | func getFaucet (k) = if ((0 > k)) | |
108 | - | then throw("Can't withdraw negative amount") | |
109 | - | else TransferSet([ScriptTransfer(d.caller, k, a)]) | |
107 | + | func getFaucet (k) = { | |
108 | + | let f = toBase58String(d.caller.bytes) | |
109 | + | let g = { | |
110 | + | let h = getInteger(this, (f + "_faucet")) | |
111 | + | if ($isInstanceOf(h, "Int")) | |
112 | + | then { | |
113 | + | let i = h | |
114 | + | i | |
115 | + | } | |
116 | + | else 0 | |
117 | + | } | |
118 | + | if ((0 > k)) | |
119 | + | then throw("Can't withdraw negative amount") | |
120 | + | else if ((g > 0)) | |
121 | + | then throw("Faucet already taken") | |
122 | + | else ScriptResult(WriteSet([DataEntry((f + "_faucet"), k)]), TransferSet([ScriptTransfer(d.caller, k, a)])) | |
123 | + | } | |
110 | 124 | ||
111 | 125 | ||
112 | 126 | @Verifier(l) | |
113 | 127 | func m () = { | |
114 | 128 | let h = l | |
115 | 129 | if ($isInstanceOf(h, "SetScriptTransaction")) | |
116 | 130 | then { | |
117 | 131 | let n = h | |
118 | 132 | sigVerify(l.bodyBytes, l.proofs[0], c) | |
119 | 133 | } | |
120 | 134 | else if ($isInstanceOf(h, "DataTransaction")) | |
121 | 135 | then { | |
122 | 136 | let n = h | |
123 | 137 | true | |
124 | 138 | } | |
125 | 139 | else false | |
126 | 140 | } | |
127 | 141 |
github/deemru/w8io/169f3d6 43.57 ms ◑