tx · 7G8jNV4EVMEziJZipFcUuvjjiZi7hNxSVxGP4uEnssWE 3NBTGfiEtHiKvpV84qrVpaqycizY8hGAxpu: -0.01400000 Waves 2020.01.03 11:01 [837402] smart account 3NBTGfiEtHiKvpV84qrVpaqycizY8hGAxpu > SELF 0.00000000 Waves
{ "type": 13, "id": "7G8jNV4EVMEziJZipFcUuvjjiZi7hNxSVxGP4uEnssWE", "fee": 1400000, "feeAssetId": null, "timestamp": 1578038558633, "version": 1, "sender": "3NBTGfiEtHiKvpV84qrVpaqycizY8hGAxpu", "senderPublicKey": "7DERSZYEoBTSwaTrN1ktwnx1Y5D46mSpMSayUNs8CmcK", "proofs": [ "gWHLTscXCdgU2s2i3viViYmSwgJ5rrGqP8vthURUGQZKo6gmcAKBDUuafpJrGCSqF3M2XrCtRzkdR1cwWnhQFvM" ], "script": "base64:AAIDAAAAAAAAAA4IARIECgIBCBIECgIBCAAAAAYAAAAAEGRhcHBBY291bnRQdWJLZXkBAAAAIFxIRFJtzw8EQGNgJYi+FoqGy/ftVpr8Tfeuof0vU4NYAAAAAAZwYXI3SWQBAAAAIM5YQP2Y4rTFk3fjHMVSaCtBnCyxqxHVfGnKN+eS6UeMAAAAAAZ1c2RuSWQBAAAAICJkPx6+YEbpEWoTE9ymM/4Wfgf5d+mz8hX8mUkqMAo3AAAAAAVidGNJZAEAAAAguec/qo8QJtuj3bookxh1fq0CogDYmuE6CdbFUTcLG40AAAAABmV1cm9JZAEAAAAgksOaihajKoQqnq8MtxuSVjR9ECuhi4KGdaumzXMlMJsAAAAAB3dhdmVzSWQBAAAABBOr2TMAAAACAAAAAWkBAAAAB2RlcG9zaXQAAAACAAAACmNvbXBlU3RhcnQAAAACaWQEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50BAAAAAlwYXltZW50SWQIBQAAAANwbXQAAAAHYXNzZXRJZAQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVy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ZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4BggVMXA=", "chainId": 84, "height": 837402, "spentComplexity": 0 } View: original | compacted Prev: HWPeNV9aLLxNv4F3a6RSpWJwr1uvXCjnwBez5Bu7EtPA Next: 6SMNt2SsSqw2VpZegNvXPrQUyaf8MUw5WAdEEFAF67tn Diff:
Old | New | Differences | |
---|---|---|---|
47 | 47 | } | |
48 | 48 | let newAmount = (currentAmount - amount) | |
49 | 49 | if ((lastBlock.timestamp > compeStart)) | |
50 | - | then throw("Can't withdraw") | |
50 | + | then throw("Can't withdraw compe start") | |
51 | 51 | else if ((0 > amount)) | |
52 | 52 | then throw("Can't withdraw negative amount") | |
53 | 53 | else if ((0 > newAmount)) | |
68 | 68 | ||
69 | 69 | @Verifier(tx) | |
70 | 70 | func verify () = match tx { | |
71 | - | case | |
71 | + | case _ => | |
72 | 72 | true | |
73 | - | case t: TransferTransaction => | |
74 | - | sigVerify(t.bodyBytes, t.proofs[0], t.senderPublicKey) | |
75 | - | case s: SetScriptTransaction => | |
76 | - | sigVerify(s.bodyBytes, s.proofs[0], s.senderPublicKey) | |
77 | - | case _ => | |
78 | - | false | |
79 | 73 | } | |
80 | 74 |
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 | let wavesId = base58'WAVES' | |
15 | 15 | ||
16 | 16 | @Callable(i) | |
17 | 17 | func deposit (compeStart,id) = { | |
18 | 18 | let pmt = extract(i.payment) | |
19 | 19 | let paymentId = pmt.assetId | |
20 | 20 | let currentKey = toBase58String(i.caller.bytes) | |
21 | 21 | let currentAmount = match getInteger(this, currentKey) { | |
22 | 22 | case a: Int => | |
23 | 23 | a | |
24 | 24 | case _ => | |
25 | 25 | 0 | |
26 | 26 | } | |
27 | 27 | let newAmount = (currentAmount + pmt.amount) | |
28 | 28 | WriteSet([DataEntry((id + currentKey), newAmount), DataEntry((id + currentKey), compeStart)]) | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | ||
33 | 33 | @Callable(i) | |
34 | 34 | func withdraw (amount,id) = { | |
35 | 35 | let currentKey = toBase58String(i.caller.bytes) | |
36 | 36 | let compeStart = match getInteger(this, ("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, currentKey) { | |
43 | 43 | case a: Int => | |
44 | 44 | a | |
45 | 45 | case _ => | |
46 | 46 | 0 | |
47 | 47 | } | |
48 | 48 | let newAmount = (currentAmount - amount) | |
49 | 49 | if ((lastBlock.timestamp > compeStart)) | |
50 | - | then throw("Can't withdraw") | |
50 | + | then throw("Can't withdraw compe start") | |
51 | 51 | else if ((0 > amount)) | |
52 | 52 | then throw("Can't withdraw negative amount") | |
53 | 53 | else if ((0 > newAmount)) | |
54 | 54 | then throw("Not enough balance") | |
55 | 55 | else if ((id == "EtV3CXQ4wqm28WPB1KaBv5B9ke2bpXRZMutYNEJUQcXm")) | |
56 | 56 | then ScriptResult(WriteSet([DataEntry((id + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, par7Id)])) | |
57 | 57 | else if ((id == "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC")) | |
58 | 58 | then ScriptResult(WriteSet([DataEntry(("USD-N_" + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, usdnId)])) | |
59 | 59 | else if ((id == "DWgwcZTMhSvnyYCoWLRUXXSH1RSkzThXLJhww9gwkqdn")) | |
60 | 60 | then ScriptResult(WriteSet([DataEntry(("BTC_" + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, btcId)])) | |
61 | 61 | else if ((id == "AsuWyM9MUUsMmWkK7jS48L3ky6gA1pxx7QtEYPbfLjAJ")) | |
62 | 62 | then ScriptResult(WriteSet([DataEntry(("EURO_" + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, euroId)])) | |
63 | 63 | else if ((id == "WAVES")) | |
64 | 64 | then ScriptResult(WriteSet([DataEntry(("WAVES_" + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, wavesId)])) | |
65 | 65 | else throw("Can't withdraw") | |
66 | 66 | } | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | @Verifier(tx) | |
70 | 70 | func verify () = match tx { | |
71 | - | case | |
71 | + | case _ => | |
72 | 72 | true | |
73 | - | case t: TransferTransaction => | |
74 | - | sigVerify(t.bodyBytes, t.proofs[0], t.senderPublicKey) | |
75 | - | case s: SetScriptTransaction => | |
76 | - | sigVerify(s.bodyBytes, s.proofs[0], s.senderPublicKey) | |
77 | - | case _ => | |
78 | - | false | |
79 | 73 | } | |
80 | 74 |
github/deemru/w8io/169f3d6 52.76 ms ◑