tx · 6DEjRXmCMd8DYiZqmQA4WsQAXF6756XS61FVBcgFXkGB 3MyV9Fm9cwW9W68VCGfPvejLujx7xVpJiKW: -0.01400000 Waves 2020.01.04 03:24 [838410] smart account 3MyV9Fm9cwW9W68VCGfPvejLujx7xVpJiKW > SELF 0.00000000 Waves
{ "type": 13, "id": "6DEjRXmCMd8DYiZqmQA4WsQAXF6756XS61FVBcgFXkGB", "fee": 1400000, "feeAssetId": null, "timestamp": 1578097515474, "version": 1, "sender": "3MyV9Fm9cwW9W68VCGfPvejLujx7xVpJiKW", "senderPublicKey": "8zVjiVAuhkkAyQsSHHvjkNNoN8WDKJAEBV5nSpiyyYWr", "proofs": [ "36b7zP6CY4V48v6DeGvE89K3Ai2QBYSDz3HzW4KbZiYs9b58ag6M1yZf4wZfCG6nWFeYptTZcoMmma1P9Adocmra" ], "script": "base64:AAIDAAAAAAAAABAIARIFCgMBCAgSBQoDAQgIAAAABQAAAAAQZGFwcEFjb3VudFB1YktleQEAAAAgXEhEUm3PDwRAY2AliL4WiobL9+1WmvxN966h/S9Tg1gAAAAABnBhcjdJZAEAAAAgzlhA/ZjitMWTd+McxVJoK0GcLLGrEdV8aco355LpR4wAAAAABnVzZG5JZAEAAAAgImQ/Hr5gRukRahMT3KYz/hZ+B/l36bPyFfyZSSowCjcAAAAABWJ0Y0lkAQAAACC55z+qjxAm26PduiiTGHV+rQKiANia4ToJ1sVRNwsbjQAAAAAGZXVyb0lkAQAAACCSw5qKFqMqhCqerwy3G5JWNH0QK6GLgoZ1q6bNcyUwmwAAAAIAAAABaQEAAAAHZGVwb3NpdAAAAAMAAAAKY29tcGVTdGFydAAAAAJpZAAAAAhjb21wZU51bQQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQEAAAACXBheW1lbnRJZAgFAAAAA3BtdAAAAAdhc3NldElkBAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXM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 838410, "spentComplexity": 0 } View: original | compacted Prev: 6LJxxk9LVmZM637kDQsjgL9UbVmxwWaRtbYW1k4SSotp Next: FFbcuEKBFXTAvS4Y4SdSGiyiNsMW4efqcomnGqJs3UGu Diff:
Old | New | Differences | |
---|---|---|---|
11 | 11 | ||
12 | 12 | let euroId = base58'AsuWyM9MUUsMmWkK7jS48L3ky6gA1pxx7QtEYPbfLjAJ' | |
13 | 13 | ||
14 | - | let compeNum = "111111" | |
15 | - | ||
16 | 14 | @Callable(i) | |
17 | - | func deposit (compeStart,id) = { | |
15 | + | func deposit (compeStart,id,compeNum) = { | |
18 | 16 | let pmt = extract(i.payment) | |
19 | 17 | let paymentId = pmt.assetId | |
20 | 18 | let currentKey = toBase58String(i.caller.bytes) | |
31 | 29 | ||
32 | 30 | ||
33 | 31 | @Callable(i) | |
34 | - | func withdraw (amount,id) = { | |
32 | + | func withdraw (amount,id,compeNum) = { | |
35 | 33 | let currentKey = toBase58String(i.caller.bytes) | |
36 | 34 | let compeStart = match getInteger(this, ((((id + "_compeStart_") + compeNum) + "_") + currentKey)) { | |
37 | 35 | case a: Int => |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let dappAcountPubKey = base58'7DERSZYEoBTSwaTrN1ktwnx1Y5D46mSpMSayUNs8CmcK' | |
5 | 5 | ||
6 | 6 | let par7Id = base58'EtV3CXQ4wqm28WPB1KaBv5B9ke2bpXRZMutYNEJUQcXm' | |
7 | 7 | ||
8 | 8 | let usdnId = base58'3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC' | |
9 | 9 | ||
10 | 10 | let btcId = base58'DWgwcZTMhSvnyYCoWLRUXXSH1RSkzThXLJhww9gwkqdn' | |
11 | 11 | ||
12 | 12 | let euroId = base58'AsuWyM9MUUsMmWkK7jS48L3ky6gA1pxx7QtEYPbfLjAJ' | |
13 | 13 | ||
14 | - | let compeNum = "111111" | |
15 | - | ||
16 | 14 | @Callable(i) | |
17 | - | func deposit (compeStart,id) = { | |
15 | + | func deposit (compeStart,id,compeNum) = { | |
18 | 16 | let pmt = extract(i.payment) | |
19 | 17 | let paymentId = pmt.assetId | |
20 | 18 | let currentKey = toBase58String(i.caller.bytes) | |
21 | 19 | let currentAmount = match getInteger(this, currentKey) { | |
22 | 20 | case a: Int => | |
23 | 21 | a | |
24 | 22 | case _ => | |
25 | 23 | 0 | |
26 | 24 | } | |
27 | 25 | let newAmount = (currentAmount + pmt.amount) | |
28 | 26 | WriteSet([DataEntry(((((id + "_") + compeNum) + "_") + currentKey), newAmount), DataEntry(((((id + "_compeStart_") + compeNum) + "_") + currentKey), compeStart)]) | |
29 | 27 | } | |
30 | 28 | ||
31 | 29 | ||
32 | 30 | ||
33 | 31 | @Callable(i) | |
34 | - | func withdraw (amount,id) = { | |
32 | + | func withdraw (amount,id,compeNum) = { | |
35 | 33 | let currentKey = toBase58String(i.caller.bytes) | |
36 | 34 | let compeStart = match getInteger(this, ((((id + "_compeStart_") + compeNum) + "_") + currentKey)) { | |
37 | 35 | case a: Int => | |
38 | 36 | a | |
39 | 37 | case _ => | |
40 | 38 | 0 | |
41 | 39 | } | |
42 | 40 | let currentAmount = match getInteger(this, ((((id + "_") + compeNum) + "_") + currentKey)) { | |
43 | 41 | case a: Int => | |
44 | 42 | a | |
45 | 43 | case _ => | |
46 | 44 | 0 | |
47 | 45 | } | |
48 | 46 | let newAmount = (currentAmount - amount) | |
49 | 47 | if ((lastBlock.timestamp > compeStart)) | |
50 | 48 | then throw("Can't withdraw compe start") | |
51 | 49 | else if ((0 > amount)) | |
52 | 50 | then throw("Can't withdraw negative amount") | |
53 | 51 | else if ((0 > newAmount)) | |
54 | 52 | then throw("Not enough balance") | |
55 | 53 | else if ((id == "EtV3CXQ4wqm28WPB1KaBv5B9ke2bpXRZMutYNEJUQcXm")) | |
56 | 54 | then ScriptResult(WriteSet([DataEntry(((((id + "_") + compeNum) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, par7Id)])) | |
57 | 55 | else if ((id == "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC")) | |
58 | 56 | then ScriptResult(WriteSet([DataEntry(((((id + "_") + compeNum) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, usdnId)])) | |
59 | 57 | else if ((id == "DWgwcZTMhSvnyYCoWLRUXXSH1RSkzThXLJhww9gwkqdn")) | |
60 | 58 | then ScriptResult(WriteSet([DataEntry(((((id + "_") + compeNum) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, btcId)])) | |
61 | 59 | else if ((id == "AsuWyM9MUUsMmWkK7jS48L3ky6gA1pxx7QtEYPbfLjAJ")) | |
62 | 60 | then ScriptResult(WriteSet([DataEntry(((((id + "_") + compeNum) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, euroId)])) | |
63 | 61 | else if ((id == "WAVES")) | |
64 | 62 | then ScriptResult(WriteSet([DataEntry(((((id + "_") + compeNum) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
65 | 63 | else throw("Can't withdraw") | |
66 | 64 | } | |
67 | 65 | ||
68 | 66 | ||
69 | 67 | @Verifier(tx) | |
70 | 68 | func verify () = match tx { | |
71 | 69 | case ttx: TransferTransaction => | |
72 | 70 | sigVerify(ttx.bodyBytes, ttx.proofs[0], ttx.senderPublicKey) | |
73 | 71 | case stx: SetScriptTransaction => | |
74 | 72 | sigVerify(stx.bodyBytes, stx.proofs[0], stx.senderPublicKey) | |
75 | 73 | case _ => | |
76 | 74 | true | |
77 | 75 | } | |
78 | 76 |
github/deemru/w8io/169f3d6 31.01 ms ◑