tx · Dxnk7j4BPC1CVNoZSR8gLsYhjmvsZ46QFj36VxjecPG3 3NBTGfiEtHiKvpV84qrVpaqycizY8hGAxpu: -0.01400000 Waves 2020.01.03 12:07 [837473] smart account 3NBTGfiEtHiKvpV84qrVpaqycizY8hGAxpu > SELF 0.00000000 Waves
{ "type": 13, "id": "Dxnk7j4BPC1CVNoZSR8gLsYhjmvsZ46QFj36VxjecPG3", "fee": 1400000, "feeAssetId": null, "timestamp": 1578042309935, "version": 1, "sender": "3NBTGfiEtHiKvpV84qrVpaqycizY8hGAxpu", "senderPublicKey": "7DERSZYEoBTSwaTrN1ktwnx1Y5D46mSpMSayUNs8CmcK", "proofs": [ "2aaeFXuGven9zyZbgedz7cPZQHZWGu5ibEH8XNsPvxSpUNsBsAyb27URPxvxdfuiV8eXAx3Nbw1gDLdQ6FxnXAia" ], "script": "base64:AAIDAAAAAAAAAA4IARIECgIBCBIECgIBCAAAAAUAAAAAEGRhcHBBY291bnRQdWJLZXkBAAAAIFxIRFJtzw8EQGNgJYi+FoqGy/ftVpr8Tfeuof0vU4NYAAAAAAZwYXI3SWQBAAAAIM5YQP2Y4rTFk3fjHMVSaCtBnCyxqxHVfGnKN+eS6UeMAAAAAAZ1c2RuSWQBAAAAICJkPx6+YEbpEWoTE9ymM/4Wfgf5d+mz8hX8mUkqMAo3AAAAAAVidGNJZAEAAAAguec/qo8QJtuj3bookxh1fq0CogDYmuE6CdbFUTcLG40AAAAABmV1cm9JZAEAAAAgksOaihajKoQqnq8MtxuSVjR9ECuhi4KGdaumzXMlMJsAAAACAAAAAWkBAAAAB2RlcG9zaXQAAAACAAAACmNvbXBlU3RhcnQAAAACaWQEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50BAAAAAlwYXltZW50SWQIBQAAAANwbXQAAAAHYXNzZXRJZAQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdX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AAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAN0dHgFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAA3R0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAA3R0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAN0dHgAAAAPc2VuZGVyUHVibGljS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAADc3R4BQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAANzdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAANzdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAADc3R4AAAAD3NlbmRlclB1YmxpY0tleQeNl3PN", "chainId": 84, "height": 837473, "spentComplexity": 0 } View: original | compacted Prev: 5kWqC7mU6ZmmEz83PbaWACfYPUXKdfJNvGa6TKPpnqYV Next: 666nhzqpZk3qZCdfDL3QZdH2ArHb4VAgnAw8k6Mzev65 Full:
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) = { | |
16 | 16 | let pmt = extract(i.payment) | |
17 | 17 | let paymentId = pmt.assetId | |
18 | 18 | let currentKey = toBase58String(i.caller.bytes) | |
19 | 19 | let currentAmount = match getInteger(this, currentKey) { | |
20 | 20 | case a: Int => | |
21 | 21 | a | |
22 | 22 | case _ => | |
23 | 23 | 0 | |
24 | 24 | } | |
25 | 25 | let newAmount = (currentAmount + pmt.amount) | |
26 | 26 | WriteSet([DataEntry((id + currentKey), newAmount), DataEntry(((id + "compeStart") + currentKey), compeStart)]) | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | 31 | @Callable(i) | |
32 | 32 | func withdraw (amount,id) = { | |
33 | 33 | let currentKey = toBase58String(i.caller.bytes) | |
34 | 34 | let compeStart = match getInteger(this, ((id + "compeStart") + currentKey)) { | |
35 | 35 | case a: Int => | |
36 | 36 | a | |
37 | 37 | case _ => | |
38 | 38 | 0 | |
39 | 39 | } | |
40 | 40 | let currentAmount = match getInteger(this, (id + currentKey)) { | |
41 | 41 | case a: Int => | |
42 | 42 | a | |
43 | 43 | case _ => | |
44 | 44 | 0 | |
45 | 45 | } | |
46 | 46 | let newAmount = (currentAmount - amount) | |
47 | 47 | if ((lastBlock.timestamp > compeStart)) | |
48 | 48 | then throw("Can't withdraw compe start") | |
49 | 49 | else if ((0 > amount)) | |
50 | 50 | then throw("Can't withdraw negative amount") | |
51 | 51 | else if ((0 > newAmount)) | |
52 | 52 | then throw("Not enough balance") | |
53 | 53 | else if ((id == "EtV3CXQ4wqm28WPB1KaBv5B9ke2bpXRZMutYNEJUQcXm")) | |
54 | 54 | then ScriptResult(WriteSet([DataEntry((id + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, par7Id)])) | |
55 | 55 | else if ((id == "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC")) | |
56 | 56 | then ScriptResult(WriteSet([DataEntry((id + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, usdnId)])) | |
57 | 57 | else if ((id == "DWgwcZTMhSvnyYCoWLRUXXSH1RSkzThXLJhww9gwkqdn")) | |
58 | 58 | then ScriptResult(WriteSet([DataEntry((id + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, btcId)])) | |
59 | 59 | else if ((id == "AsuWyM9MUUsMmWkK7jS48L3ky6gA1pxx7QtEYPbfLjAJ")) | |
60 | 60 | then ScriptResult(WriteSet([DataEntry((id + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, euroId)])) | |
61 | 61 | else if ((id == "WAVES")) | |
62 | 62 | then ScriptResult(WriteSet([DataEntry((id + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
63 | 63 | else throw("Can't withdraw") | |
64 | 64 | } | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | @Verifier(tx) | |
68 | 68 | func verify () = match tx { | |
69 | 69 | case ttx: TransferTransaction => | |
70 | 70 | sigVerify(ttx.bodyBytes, ttx.proofs[0], ttx.senderPublicKey) | |
71 | 71 | case stx: SetScriptTransaction => | |
72 | 72 | sigVerify(stx.bodyBytes, stx.proofs[0], stx.senderPublicKey) | |
73 | 73 | case _ => | |
74 | 74 | false | |
75 | 75 | } | |
76 | 76 |
github/deemru/w8io/026f985 34.04 ms ◑