tx · FFrLygYMTPpHGDKLyvVRcFVYPTNi1b1GS7w3uj96HTcU 3MyV9Fm9cwW9W68VCGfPvejLujx7xVpJiKW: -0.01400000 Waves 2020.01.12 13:50 [850720] smart account 3MyV9Fm9cwW9W68VCGfPvejLujx7xVpJiKW > SELF 0.00000000 Waves
{ "type": 13, "id": "FFrLygYMTPpHGDKLyvVRcFVYPTNi1b1GS7w3uj96HTcU", "fee": 1400000, "feeAssetId": null, "timestamp": 1578826246547, "version": 1, "sender": "3MyV9Fm9cwW9W68VCGfPvejLujx7xVpJiKW", "senderPublicKey": "8zVjiVAuhkkAyQsSHHvjkNNoN8WDKJAEBV5nSpiyyYWr", "proofs": [ "26fGgUU7eZuMoocyZUFwR6i95f98Xb5WrryjpYekmFnaocpesesEGKL4J8fYBazzWGe7k7eP7HyhyhuYV6WMNwEV" ], "script": "base64:AAIDAAAAAAAAABAIARIFCgMBCAESBQoDAQgBAAAABQAAAAAQZGFwcEFjb3VudFB1YktleQEAAAAgXEhEUm3PDwRAY2AliL4WiobL9+1WmvxN966h/S9Tg1gAAAAABnBhcjdJZAEAAAAgzlhA/ZjitMWTd+McxVJoK0GcLLGrEdV8aco355LpR4wAAAAABnVzZG5JZAEAAAAgImQ/Hr5gRukRahMT3KYz/hZ+B/l36bPyFfyZSSowCjcAAAAABWJ0Y0lkAQAAACC55z+qjxAm26PduiiTGHV+rQKiANia4ToJ1sVRNwsbjQAAAAAGZXVyb0lkAQAAACCSw5qKFqMqhCqerwy3G5JWNH0QK6GLgoZ1q6bNcyUwmwAAAAIAAAABaQEAAAAHZGVwb3NpdAAAAAMAAAAKY29tcGVTdGFydAAAAAJpZAAAAAVjb21wZQQAAAAIY29tcGVOdW0JAAGkAAAAAQUAAAAFY29tcGUEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50BAAAAAlwYXltZW50SWQIBQAAAANwbXQAAAAHYXNzZXRJZAQAAAAKY3VycmVudEtleQkAAlgAAAABCA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SGiyiNsMW4efqcomnGqJs3UGu Next: 4G5RnDBDo4p2q2AqiKVEMBtbYviqKb51zAjakS9hHrPc Diff:
Old | New | Differences | |
---|---|---|---|
46 | 46 | 0 | |
47 | 47 | } | |
48 | 48 | let newAmount = (currentAmount - amount) | |
49 | - | if ((lastBlock.timestamp > compeStart)) | |
50 | - | then throw("Can't withdraw compe start") | |
51 | - | else if ((0 > amount)) | |
52 | - | then throw("Can't withdraw negative amount") | |
53 | - | else if ((0 > newAmount)) | |
54 | - | then throw("Not enough balance") | |
55 | - | else if ((id == "EtV3CXQ4wqm28WPB1KaBv5B9ke2bpXRZMutYNEJUQcXm")) | |
56 | - | then ScriptResult(WriteSet([DataEntry(((((id + "_") + compeNum) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, par7Id)])) | |
57 | - | else if ((id == "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC")) | |
58 | - | then ScriptResult(WriteSet([DataEntry(((((id + "_") + compeNum) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, usdnId)])) | |
59 | - | else if ((id == "DWgwcZTMhSvnyYCoWLRUXXSH1RSkzThXLJhww9gwkqdn")) | |
60 | - | then ScriptResult(WriteSet([DataEntry(((((id + "_") + compeNum) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, btcId)])) | |
61 | - | else if ((id == "AsuWyM9MUUsMmWkK7jS48L3ky6gA1pxx7QtEYPbfLjAJ")) | |
62 | - | then ScriptResult(WriteSet([DataEntry(((((id + "_") + compeNum) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, euroId)])) | |
63 | - | else if ((id == "WAVES")) | |
64 | - | then ScriptResult(WriteSet([DataEntry(((((id + "_") + compeNum) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
65 | - | else throw("Can't withdraw") | |
49 | + | if ((0 > amount)) | |
50 | + | then throw("Can't withdraw negative amount") | |
51 | + | else if ((0 > newAmount)) | |
52 | + | then throw("Not enough balance") | |
53 | + | else if ((id == "EtV3CXQ4wqm28WPB1KaBv5B9ke2bpXRZMutYNEJUQcXm")) | |
54 | + | then ScriptResult(WriteSet([DataEntry(((((compeNum + "_") + id) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, par7Id)])) | |
55 | + | else if ((id == "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC")) | |
56 | + | then ScriptResult(WriteSet([DataEntry(((((compeNum + "_") + id) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, usdnId)])) | |
57 | + | else if ((id == "DWgwcZTMhSvnyYCoWLRUXXSH1RSkzThXLJhww9gwkqdn")) | |
58 | + | then ScriptResult(WriteSet([DataEntry(((((compeNum + "_") + id) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, btcId)])) | |
59 | + | else if ((id == "AsuWyM9MUUsMmWkK7jS48L3ky6gA1pxx7QtEYPbfLjAJ")) | |
60 | + | then ScriptResult(WriteSet([DataEntry(((((compeNum + "_") + id) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, euroId)])) | |
61 | + | else if ((id == "WAVES")) | |
62 | + | then ScriptResult(WriteSet([DataEntry(((((compeNum + "_") + id) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
63 | + | else throw("Can't withdraw") | |
66 | 64 | } | |
67 | 65 | ||
68 | 66 |
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 | 14 | @Callable(i) | |
15 | 15 | func deposit (compeStart,id,compe) = { | |
16 | 16 | let compeNum = toString(compe) | |
17 | 17 | let pmt = extract(i.payment) | |
18 | 18 | let paymentId = pmt.assetId | |
19 | 19 | let currentKey = toBase58String(i.caller.bytes) | |
20 | 20 | let currentAmount = match getInteger(this, currentKey) { | |
21 | 21 | case a: Int => | |
22 | 22 | a | |
23 | 23 | case _ => | |
24 | 24 | 0 | |
25 | 25 | } | |
26 | 26 | let newAmount = (currentAmount + pmt.amount) | |
27 | 27 | WriteSet([DataEntry(((((compeNum + "_") + id) + "_") + currentKey), newAmount), DataEntry(((((compeNum + "_") + id) + "_compeStart_") + currentKey), compeStart)]) | |
28 | 28 | } | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | ||
32 | 32 | @Callable(i) | |
33 | 33 | func withdraw (amount,id,compe) = { | |
34 | 34 | let compeNum = toString(compe) | |
35 | 35 | let currentKey = toBase58String(i.caller.bytes) | |
36 | 36 | let compeStart = match getInteger(this, ((((compeNum + "_") + id) + "_compeStart_") + currentKey)) { | |
37 | 37 | case a: Int => | |
38 | 38 | a | |
39 | 39 | case _ => | |
40 | 40 | 0 | |
41 | 41 | } | |
42 | 42 | let currentAmount = match getInteger(this, ((((compeNum + "_") + id) + "_") + currentKey)) { | |
43 | 43 | case a: Int => | |
44 | 44 | a | |
45 | 45 | case _ => | |
46 | 46 | 0 | |
47 | 47 | } | |
48 | 48 | let newAmount = (currentAmount - amount) | |
49 | - | if ((lastBlock.timestamp > compeStart)) | |
50 | - | then throw("Can't withdraw compe start") | |
51 | - | else if ((0 > amount)) | |
52 | - | then throw("Can't withdraw negative amount") | |
53 | - | else if ((0 > newAmount)) | |
54 | - | then throw("Not enough balance") | |
55 | - | else if ((id == "EtV3CXQ4wqm28WPB1KaBv5B9ke2bpXRZMutYNEJUQcXm")) | |
56 | - | then ScriptResult(WriteSet([DataEntry(((((id + "_") + compeNum) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, par7Id)])) | |
57 | - | else if ((id == "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC")) | |
58 | - | then ScriptResult(WriteSet([DataEntry(((((id + "_") + compeNum) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, usdnId)])) | |
59 | - | else if ((id == "DWgwcZTMhSvnyYCoWLRUXXSH1RSkzThXLJhww9gwkqdn")) | |
60 | - | then ScriptResult(WriteSet([DataEntry(((((id + "_") + compeNum) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, btcId)])) | |
61 | - | else if ((id == "AsuWyM9MUUsMmWkK7jS48L3ky6gA1pxx7QtEYPbfLjAJ")) | |
62 | - | then ScriptResult(WriteSet([DataEntry(((((id + "_") + compeNum) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, euroId)])) | |
63 | - | else if ((id == "WAVES")) | |
64 | - | then ScriptResult(WriteSet([DataEntry(((((id + "_") + compeNum) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
65 | - | else throw("Can't withdraw") | |
49 | + | if ((0 > amount)) | |
50 | + | then throw("Can't withdraw negative amount") | |
51 | + | else if ((0 > newAmount)) | |
52 | + | then throw("Not enough balance") | |
53 | + | else if ((id == "EtV3CXQ4wqm28WPB1KaBv5B9ke2bpXRZMutYNEJUQcXm")) | |
54 | + | then ScriptResult(WriteSet([DataEntry(((((compeNum + "_") + id) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, par7Id)])) | |
55 | + | else if ((id == "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC")) | |
56 | + | then ScriptResult(WriteSet([DataEntry(((((compeNum + "_") + id) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, usdnId)])) | |
57 | + | else if ((id == "DWgwcZTMhSvnyYCoWLRUXXSH1RSkzThXLJhww9gwkqdn")) | |
58 | + | then ScriptResult(WriteSet([DataEntry(((((compeNum + "_") + id) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, btcId)])) | |
59 | + | else if ((id == "AsuWyM9MUUsMmWkK7jS48L3ky6gA1pxx7QtEYPbfLjAJ")) | |
60 | + | then ScriptResult(WriteSet([DataEntry(((((compeNum + "_") + id) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, euroId)])) | |
61 | + | else if ((id == "WAVES")) | |
62 | + | then ScriptResult(WriteSet([DataEntry(((((compeNum + "_") + id) + "_") + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
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 42.70 ms ◑