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+A7lXL1UaMULAAAAAMAAAABaQEAAAAIcHVyY2hhcmUAAAAABAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAkeW91IGNhbiB1c2UgV0FWRVMgb25seSBhdCB0aGUgbW9tZW50BAAAAA5jdXN0b21lckFkZHJlcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAVwcmljZQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzAgAAABNpdGVtX0FfY291cG9uX3ByaWNlAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAADCQAAZgAAAAIFAAAABXByaWNlCAUAAAADcG10AAAABmFtb3VudAkAAAI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wAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAWEFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAVvd25lcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAFiBQAAAAckbWF0Y2gwBgeRWOaH", "chainId": 84, "height": 723138, "spentComplexity": 0 } View: original | compacted Prev: 69Q4aua1LgmNxq3kEv1eZAJSSV2XmPNGgTcfLrSMNy93 Next: 8NCvqyjmtQstQ75WrkrNXTxFduHQxDRAYpJfvVeotNXD Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 let owner = base58'EEGsMXJbL3i6pER7gfBpcw87Km3h2gz6qiqhqPXbdob1'
55
6+@Callable(i)
7+func purchare () = {
8+ let pmt = extract(i.payment)
9+ if (isDefined(pmt.assetId))
10+ then throw("you can use WAVES only at the moment")
11+ else {
12+ let customerAddres = toBase58String(i.caller.bytes)
13+ let price = match getInteger(this, "item_A_coupon_price") {
14+ case a: Int =>
15+ a
16+ case _ =>
17+ 0
18+ }
19+ if ((price > pmt.amount))
20+ then throw("purchare amount cannot be less that item price")
21+ else if ((pmt.amount > price))
22+ then throw("purchare amount cannot be higher that item price")
23+ else WriteSet([DataEntry(("status:purchare_item_A_customer_" + customerAddres), "confirmed"), DataEntry(("price:purchare_item_A_customer" + customerAddres), price)])
24+ }
25+ }
26+
27+
28+
29+@Callable(i)
30+func deposit () = {
31+ let pmt = extract(i.payment)
32+ if (isDefined(pmt.assetId))
33+ then throw("you can use WAVES only at the moment")
34+ else {
35+ let currentKey = toBase58String(i.caller.bytes)
36+ let currentAmount = match getInteger(this, ("wl_sts" + currentKey)) {
37+ case a: Int =>
38+ a
39+ case _ =>
40+ 0
41+ }
42+ let wlStsCurr = match getString(this, ("wls_sts" + currentKey)) {
43+ case a: String =>
44+ a
45+ case _ =>
46+ throw("user has not waitlisted")
47+ }
48+ let newAmount = (currentAmount + pmt.amount)
49+ WriteSet([DataEntry(currentKey, newAmount)])
50+ }
51+ }
52+
53+
54+
55+@Callable(i)
56+func withdraw (amount) = {
57+ let currentKey = toBase58String(i.caller.bytes)
58+ let currentAmount = match getInteger(this, currentKey) {
59+ case a: Int =>
60+ a
61+ case _ =>
62+ 0
63+ }
64+ let newAmount = (currentAmount - amount)
65+ if ((0 > amount))
66+ then throw("can't withdraw negative amount")
67+ else if ((0 > newAmount))
68+ then throw("not enough balance")
69+ else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
70+ }
71+
672
773 @Verifier(tx)
874 func verify () = match tx {
9- case t: SetScriptTransaction =>
75+ case a: SetScriptTransaction =>
1076 sigVerify(tx.bodyBytes, tx.proofs[0], owner)
1177 case b: DataTransaction =>
1278 true
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let owner = base58'EEGsMXJbL3i6pER7gfBpcw87Km3h2gz6qiqhqPXbdob1'
55
6+@Callable(i)
7+func purchare () = {
8+ let pmt = extract(i.payment)
9+ if (isDefined(pmt.assetId))
10+ then throw("you can use WAVES only at the moment")
11+ else {
12+ let customerAddres = toBase58String(i.caller.bytes)
13+ let price = match getInteger(this, "item_A_coupon_price") {
14+ case a: Int =>
15+ a
16+ case _ =>
17+ 0
18+ }
19+ if ((price > pmt.amount))
20+ then throw("purchare amount cannot be less that item price")
21+ else if ((pmt.amount > price))
22+ then throw("purchare amount cannot be higher that item price")
23+ else WriteSet([DataEntry(("status:purchare_item_A_customer_" + customerAddres), "confirmed"), DataEntry(("price:purchare_item_A_customer" + customerAddres), price)])
24+ }
25+ }
26+
27+
28+
29+@Callable(i)
30+func deposit () = {
31+ let pmt = extract(i.payment)
32+ if (isDefined(pmt.assetId))
33+ then throw("you can use WAVES only at the moment")
34+ else {
35+ let currentKey = toBase58String(i.caller.bytes)
36+ let currentAmount = match getInteger(this, ("wl_sts" + currentKey)) {
37+ case a: Int =>
38+ a
39+ case _ =>
40+ 0
41+ }
42+ let wlStsCurr = match getString(this, ("wls_sts" + currentKey)) {
43+ case a: String =>
44+ a
45+ case _ =>
46+ throw("user has not waitlisted")
47+ }
48+ let newAmount = (currentAmount + pmt.amount)
49+ WriteSet([DataEntry(currentKey, newAmount)])
50+ }
51+ }
52+
53+
54+
55+@Callable(i)
56+func withdraw (amount) = {
57+ let currentKey = toBase58String(i.caller.bytes)
58+ let currentAmount = match getInteger(this, currentKey) {
59+ case a: Int =>
60+ a
61+ case _ =>
62+ 0
63+ }
64+ let newAmount = (currentAmount - amount)
65+ if ((0 > amount))
66+ then throw("can't withdraw negative amount")
67+ else if ((0 > newAmount))
68+ then throw("not enough balance")
69+ else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
70+ }
71+
672
773 @Verifier(tx)
874 func verify () = match tx {
9- case t: SetScriptTransaction =>
75+ case a: SetScriptTransaction =>
1076 sigVerify(tx.bodyBytes, tx.proofs[0], owner)
1177 case b: DataTransaction =>
1278 true
1379 case _ =>
1480 false
1581 }
1682

github/deemru/w8io/169f3d6 
64.26 ms