tx · 975vcv2pVJqDGFJV7ifG6uGFXXdDMFgrHEWJ9mtVVrCb
3N3mGfzEZRpBgriK6rWYSTcYBrTkKXvp2Dg: -0.05000000 Waves
2019.08.22 22:42 [642763] smart account 3N3mGfzEZRpBgriK6rWYSTcYBrTkKXvp2Dg > SELF 0.00000000 Waves
{
"type": 13,
"id": "975vcv2pVJqDGFJV7ifG6uGFXXdDMFgrHEWJ9mtVVrCb",
"fee": 5000000,
"feeAssetId": null,
"timestamp": 1566502942385,
"version": 1,
"sender": "3N3mGfzEZRpBgriK6rWYSTcYBrTkKXvp2Dg",
"senderPublicKey": "F7bawANKyaihuQGk4ymySirxkmPhrdZNeFif6P82X38X",
"proofs": [
"5azT1EeVDoEtAGqPGf6HZN5YfHCRwEMqNfk2GvyrzzaH9z7VnbX633gND7y1ef7QYjZw399vwEy46euArfbSVyJZ"
],
"script": "base64:AAIDAAAAAAAAAAAAAAABAAAAAA5vd25lclB1YmxpY0tleQEAAAAg0bQ1EG8FJT/TxwUU+Wf6cP+0TDqhL7Aq6gz1qHiOLxwAAAABAAAAAWkBAAAACHB1cmNoYXNlAAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAIENhbiB1c2UgV0FWRVMgb25seSBhdCB0aGUgbW9tZW50BAAAAA9jdXN0b21lckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAFcHJpY2UEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwIAAAATaXRlbV9BX2NvdXBvbl9wcmljZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAwkAAGYAAAACBQAAAAVwcmljZQgFAAAAA3BtdAAAAAZhbW91bnQJAAACAAAAAQIAAAAvcHVyY2hhc2UgYW1vdW50IGNhbiBub3QgYmUgbGVzcyB0aGVuIGl0ZW0gcHJpY2UDCQAAZgAAAAIIBQAAAANwbXQAAAAGYW1vdW50BQAAAAVwcmljZQkAAAIAAAABAgAAADFwdXJjaGFzZSBhbW91bnQgY2FuIG5vdCBiZSBoaWdoZXIgdGhlbiBpdGVtIHByaWNlCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAAIHN0YXR1czpwdXJjaGFzZV9pdGVtX0FfY3VzdG9tZXJfBQAAAA9jdXN0b21lckFkZHJlc3MCAAAACWNvbmZpcm1lZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAACBwcmljZTogcHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzBQAAAAVwcmljZQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAAF0BQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAOb3duZXJQdWJsaWNLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYHKkNyQg==",
"chainId": 84,
"height": 642763,
"spentComplexity": 0
}
View: original | compacted
Prev: FPfHQwtKUJiQStL5ZYXMqzaZJ4QpCaRRdfqMR5sJ7WNy
Next: HUsTDdFrowB4GfHmDpr76324fn9d3DqZdRCGp4jMy2o6
Diff:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
| 4 | + | let a = base58'F7bawANKyaihuQGk4ymySirxkmPhrdZNeFif6P82X38X' |
---|
| 5 | + | |
---|
| 6 | + | @Callable(b) |
---|
| 7 | + | func purchase () = { |
---|
| 8 | + | let c = extract(b.payment) |
---|
| 9 | + | if (isDefined(c.assetId)) |
---|
| 10 | + | then throw("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("purchase amount can not be less then item price") |
---|
| 24 | + | else if ((c.amount > e)) |
---|
| 25 | + | then throw("purchase amount can not be higher then item price") |
---|
| 26 | + | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + d), "confirmed"), DataEntry(("price: purchase_item_A_customer_" + d), e)]) |
---|
| 27 | + | } |
---|
| 28 | + | } |
---|
4 | 29 | | |
---|
5 | 30 | | |
---|
6 | | - | |
---|
7 | | - | @Verifier(a) |
---|
8 | | - | func b () = { |
---|
9 | | - | let c = a |
---|
10 | | - | if ($isInstanceOf(c, "SetScriptTransaction")) |
---|
| 31 | + | @Verifier(h) |
---|
| 32 | + | func i () = { |
---|
| 33 | + | let f = h |
---|
| 34 | + | if ($isInstanceOf(f, "SetScriptTransaction")) |
---|
11 | 35 | | then { |
---|
12 | | - | let d = c |
---|
13 | | - | true |
---|
| 36 | + | let j = f |
---|
| 37 | + | sigVerify(h.bodyBytes, h.proofs[0], a) |
---|
14 | 38 | | } |
---|
15 | | - | else if ($isInstanceOf(c, "DataTransaction")) |
---|
| 39 | + | else if ($isInstanceOf(f, "DataTransaction")) |
---|
16 | 40 | | then { |
---|
17 | | - | let d = c |
---|
| 41 | + | let k = f |
---|
18 | 42 | | true |
---|
19 | 43 | | } |
---|
20 | 44 | | else false |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
| 4 | + | let a = base58'F7bawANKyaihuQGk4ymySirxkmPhrdZNeFif6P82X38X' |
---|
| 5 | + | |
---|
| 6 | + | @Callable(b) |
---|
| 7 | + | func purchase () = { |
---|
| 8 | + | let c = extract(b.payment) |
---|
| 9 | + | if (isDefined(c.assetId)) |
---|
| 10 | + | then throw("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("purchase amount can not be less then item price") |
---|
| 24 | + | else if ((c.amount > e)) |
---|
| 25 | + | then throw("purchase amount can not be higher then item price") |
---|
| 26 | + | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + d), "confirmed"), DataEntry(("price: purchase_item_A_customer_" + d), e)]) |
---|
| 27 | + | } |
---|
| 28 | + | } |
---|
4 | 29 | | |
---|
5 | 30 | | |
---|
6 | | - | |
---|
7 | | - | @Verifier(a) |
---|
8 | | - | func b () = { |
---|
9 | | - | let c = a |
---|
10 | | - | if ($isInstanceOf(c, "SetScriptTransaction")) |
---|
| 31 | + | @Verifier(h) |
---|
| 32 | + | func i () = { |
---|
| 33 | + | let f = h |
---|
| 34 | + | if ($isInstanceOf(f, "SetScriptTransaction")) |
---|
11 | 35 | | then { |
---|
12 | | - | let d = c |
---|
13 | | - | true |
---|
| 36 | + | let j = f |
---|
| 37 | + | sigVerify(h.bodyBytes, h.proofs[0], a) |
---|
14 | 38 | | } |
---|
15 | | - | else if ($isInstanceOf(c, "DataTransaction")) |
---|
| 39 | + | else if ($isInstanceOf(f, "DataTransaction")) |
---|
16 | 40 | | then { |
---|
17 | | - | let d = c |
---|
| 41 | + | let k = f |
---|
18 | 42 | | true |
---|
19 | 43 | | } |
---|
20 | 44 | | else false |
---|
21 | 45 | | } |
---|
22 | 46 | | |
---|