tx · 2RZV2V7Zt7uuBL5AMmoqSNqfbhy8Bdqjc8EN2iRsRxfb 3N9nVNxRXkYG1LxBamitnLpZzXcjGDZ2Q6z: -0.01400000 Waves 2019.10.17 01:12 [723138] smart account 3N9nVNxRXkYG1LxBamitnLpZzXcjGDZ2Q6z > SELF 0.00000000 Waves
{ "type": 13, "id": "2RZV2V7Zt7uuBL5AMmoqSNqfbhy8Bdqjc8EN2iRsRxfb", "fee": 1400000, "feeAssetId": null, "timestamp": 1571263793778, "version": 1, "sender": "3N9nVNxRXkYG1LxBamitnLpZzXcjGDZ2Q6z", "senderPublicKey": "EEGsMXJbL3i6pER7gfBpcw87Km3h2gz6qiqhqPXbdob1", "proofs": [ "4bYi684RdMvg1RE4gPTxfD9vgDHwze2Vi1P3YxoK6tASYyJ552Fuzj7unJ9hMV4wi7SLGsXbv6KxDa5YPx6HR7qj" ], "script": "base64:AAIDAAAAAAAAAAsIARIAEgASAwoBAQAAAAEAAAAABW93bmVyAQAAACDEjmw5zzkX3oDIwQ5BL5mutxduNY61q+A7lXL1UaMULAAAAAMAAAABaQEAAAAIcHVyY2hhcmUAAAAABAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAkeW91IGNhbiB1c2UgV0FWRVMgb25seSBhdCB0aGUgbW9tZW50BAAAAA5jdXN0b21lckFkZHJlcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAVwcmljZQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzAgAAABNpdGVtX0FfY291cG9uX3ByaWNlAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAADCQAAZgAAAAIFAAAABXByaWNlCAUAAAADcG10AAAABmFtb3VudAkAAAIA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AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAWEFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAVvd25lcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAFiBQAAAAckbWF0Y2gwBgeRWOaH", "chainId": 84, "height": 723138, "spentComplexity": 0 } View: original | compacted Prev: 69Q4aua1LgmNxq3kEv1eZAJSSV2XmPNGgTcfLrSMNy93 Next: 8NCvqyjmtQstQ75WrkrNXTxFduHQxDRAYpJfvVeotNXD Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'EEGsMXJbL3i6pER7gfBpcw87Km3h2gz6qiqhqPXbdob1' | |
5 | 5 | ||
6 | + | @Callable(b) | |
7 | + | func purchare () = { | |
8 | + | let c = extract(b.payment) | |
9 | + | if (isDefined(c.assetId)) | |
10 | + | then throw("you can use WAVES only at the moment") | |
11 | + | else { | |
12 | + | let d = toBase58String(b.caller.bytes) | |
13 | + | let e = { | |
14 | + | let f = getInteger(this, "item_A_coupon_price") | |
15 | + | if ($isInstanceOf(f, "Int")) | |
16 | + | then { | |
17 | + | let g = f | |
18 | + | g | |
19 | + | } | |
20 | + | else 0 | |
21 | + | } | |
22 | + | if ((e > c.amount)) | |
23 | + | then throw("purchare amount cannot be less that item price") | |
24 | + | else if ((c.amount > e)) | |
25 | + | then throw("purchare amount cannot be higher that item price") | |
26 | + | else WriteSet([DataEntry(("status:purchare_item_A_customer_" + d), "confirmed"), DataEntry(("price:purchare_item_A_customer" + d), e)]) | |
27 | + | } | |
28 | + | } | |
6 | 29 | ||
7 | - | @Verifier(b) | |
8 | - | func c () = { | |
9 | - | let d = b | |
10 | - | if ($isInstanceOf(d, "SetScriptTransaction")) | |
30 | + | ||
31 | + | ||
32 | + | @Callable(b) | |
33 | + | func deposit () = { | |
34 | + | let c = extract(b.payment) | |
35 | + | if (isDefined(c.assetId)) | |
36 | + | then throw("you can use WAVES only at the moment") | |
37 | + | else { | |
38 | + | let h = toBase58String(b.caller.bytes) | |
39 | + | let i = { | |
40 | + | let f = getInteger(this, ("wl_sts" + h)) | |
41 | + | if ($isInstanceOf(f, "Int")) | |
42 | + | then { | |
43 | + | let g = f | |
44 | + | g | |
45 | + | } | |
46 | + | else 0 | |
47 | + | } | |
48 | + | let j = { | |
49 | + | let f = getString(this, ("wls_sts" + h)) | |
50 | + | if ($isInstanceOf(f, "String")) | |
51 | + | then { | |
52 | + | let g = f | |
53 | + | g | |
54 | + | } | |
55 | + | else throw("user has not waitlisted") | |
56 | + | } | |
57 | + | let k = (i + c.amount) | |
58 | + | WriteSet([DataEntry(h, k)]) | |
59 | + | } | |
60 | + | } | |
61 | + | ||
62 | + | ||
63 | + | ||
64 | + | @Callable(b) | |
65 | + | func withdraw (l) = { | |
66 | + | let h = toBase58String(b.caller.bytes) | |
67 | + | let i = { | |
68 | + | let f = getInteger(this, h) | |
69 | + | if ($isInstanceOf(f, "Int")) | |
70 | + | then { | |
71 | + | let g = f | |
72 | + | g | |
73 | + | } | |
74 | + | else 0 | |
75 | + | } | |
76 | + | let k = (i - l) | |
77 | + | if ((0 > l)) | |
78 | + | then throw("can't withdraw negative amount") | |
79 | + | else if ((0 > k)) | |
80 | + | then throw("not enough balance") | |
81 | + | else ScriptResult(WriteSet([DataEntry(h, k)]), TransferSet([ScriptTransfer(b.caller, l, unit)])) | |
82 | + | } | |
83 | + | ||
84 | + | ||
85 | + | @Verifier(m) | |
86 | + | func n () = { | |
87 | + | let f = m | |
88 | + | if ($isInstanceOf(f, "SetScriptTransaction")) | |
11 | 89 | then { | |
12 | - | let | |
13 | - | sigVerify( | |
90 | + | let g = f | |
91 | + | sigVerify(m.bodyBytes, m.proofs[0], a) | |
14 | 92 | } | |
15 | - | else if ($isInstanceOf( | |
93 | + | else if ($isInstanceOf(f, "DataTransaction")) | |
16 | 94 | then { | |
17 | - | let | |
95 | + | let o = f | |
18 | 96 | true | |
19 | 97 | } | |
20 | 98 | else false |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'EEGsMXJbL3i6pER7gfBpcw87Km3h2gz6qiqhqPXbdob1' | |
5 | 5 | ||
6 | + | @Callable(b) | |
7 | + | func purchare () = { | |
8 | + | let c = extract(b.payment) | |
9 | + | if (isDefined(c.assetId)) | |
10 | + | then throw("you can use WAVES only at the moment") | |
11 | + | else { | |
12 | + | let d = toBase58String(b.caller.bytes) | |
13 | + | let e = { | |
14 | + | let f = getInteger(this, "item_A_coupon_price") | |
15 | + | if ($isInstanceOf(f, "Int")) | |
16 | + | then { | |
17 | + | let g = f | |
18 | + | g | |
19 | + | } | |
20 | + | else 0 | |
21 | + | } | |
22 | + | if ((e > c.amount)) | |
23 | + | then throw("purchare amount cannot be less that item price") | |
24 | + | else if ((c.amount > e)) | |
25 | + | then throw("purchare amount cannot be higher that item price") | |
26 | + | else WriteSet([DataEntry(("status:purchare_item_A_customer_" + d), "confirmed"), DataEntry(("price:purchare_item_A_customer" + d), e)]) | |
27 | + | } | |
28 | + | } | |
6 | 29 | ||
7 | - | @Verifier(b) | |
8 | - | func c () = { | |
9 | - | let d = b | |
10 | - | if ($isInstanceOf(d, "SetScriptTransaction")) | |
30 | + | ||
31 | + | ||
32 | + | @Callable(b) | |
33 | + | func deposit () = { | |
34 | + | let c = extract(b.payment) | |
35 | + | if (isDefined(c.assetId)) | |
36 | + | then throw("you can use WAVES only at the moment") | |
37 | + | else { | |
38 | + | let h = toBase58String(b.caller.bytes) | |
39 | + | let i = { | |
40 | + | let f = getInteger(this, ("wl_sts" + h)) | |
41 | + | if ($isInstanceOf(f, "Int")) | |
42 | + | then { | |
43 | + | let g = f | |
44 | + | g | |
45 | + | } | |
46 | + | else 0 | |
47 | + | } | |
48 | + | let j = { | |
49 | + | let f = getString(this, ("wls_sts" + h)) | |
50 | + | if ($isInstanceOf(f, "String")) | |
51 | + | then { | |
52 | + | let g = f | |
53 | + | g | |
54 | + | } | |
55 | + | else throw("user has not waitlisted") | |
56 | + | } | |
57 | + | let k = (i + c.amount) | |
58 | + | WriteSet([DataEntry(h, k)]) | |
59 | + | } | |
60 | + | } | |
61 | + | ||
62 | + | ||
63 | + | ||
64 | + | @Callable(b) | |
65 | + | func withdraw (l) = { | |
66 | + | let h = toBase58String(b.caller.bytes) | |
67 | + | let i = { | |
68 | + | let f = getInteger(this, h) | |
69 | + | if ($isInstanceOf(f, "Int")) | |
70 | + | then { | |
71 | + | let g = f | |
72 | + | g | |
73 | + | } | |
74 | + | else 0 | |
75 | + | } | |
76 | + | let k = (i - l) | |
77 | + | if ((0 > l)) | |
78 | + | then throw("can't withdraw negative amount") | |
79 | + | else if ((0 > k)) | |
80 | + | then throw("not enough balance") | |
81 | + | else ScriptResult(WriteSet([DataEntry(h, k)]), TransferSet([ScriptTransfer(b.caller, l, unit)])) | |
82 | + | } | |
83 | + | ||
84 | + | ||
85 | + | @Verifier(m) | |
86 | + | func n () = { | |
87 | + | let f = m | |
88 | + | if ($isInstanceOf(f, "SetScriptTransaction")) | |
11 | 89 | then { | |
12 | - | let | |
13 | - | sigVerify( | |
90 | + | let g = f | |
91 | + | sigVerify(m.bodyBytes, m.proofs[0], a) | |
14 | 92 | } | |
15 | - | else if ($isInstanceOf( | |
93 | + | else if ($isInstanceOf(f, "DataTransaction")) | |
16 | 94 | then { | |
17 | - | let | |
95 | + | let o = f | |
18 | 96 | true | |
19 | 97 | } | |
20 | 98 | else false | |
21 | 99 | } | |
22 | 100 |
github/deemru/w8io/169f3d6 42.82 ms ◑