tx · DfgSc9PKS9zuT5gQVTaM5MZjkt1tTeSi52jpb3C1gRm6
3MwrbksXinhUhJ9ewTxuxiPfKVsTx9GCbYC: -0.01400000 Waves
2022.02.16 15:53 [1926202] smart account 3MwrbksXinhUhJ9ewTxuxiPfKVsTx9GCbYC > SELF 0.00000000 Waves
{
"type": 13,
"id": "DfgSc9PKS9zuT5gQVTaM5MZjkt1tTeSi52jpb3C1gRm6",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1645016085652,
"version": 2,
"chainId": 84,
"sender": "3MwrbksXinhUhJ9ewTxuxiPfKVsTx9GCbYC",
"senderPublicKey": "2Yr3nmcvFCJn3eLnhcLTwY36srATJViCmv9AMCiuuNMd",
"proofs": [
"NWTQWV2Qc9JhhMN6RCM7tX6eotS6dEHqpKmrU8XXphgLEiPFRp1rkfpNoPQBtb2fyzHJBaygXiSTpaQ13WHqhKx"
],
"script": "base64:AAIDAAAAAAAAAAwIARIDCgEBEgMKAQEAAAAAAAAAAgAAAAFpAQAAAAxjdXN0b21lckJ1eUEAAAABAAAABmFtb3VudAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAIENhbiB1c2UgV2F2ZXMgb25seSBhdCB0aGUgbW9tZW50BAAAAA9jdXN0b21lckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAFcHJpY2UEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwIAAAATaXRlbV9BX2NvdXBvbl9wcmljZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAwkAAGYAAAACBQAAAAVwcmljZQUAAAAGYW1vdW50CQAAAgAAAAECAAAALlB1cmNoYXNlIGFtb3VudCBjYW5ub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aWNlCQAAAgAAAAECAAAAMFB1cmNoYXNlIGFtb3VudCBjYW5ub3QgYmUgaGlnaGVyIHRoYW4gaXRlbSBwcmljZQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAACBzdGF0dXM6cHVyY2hhc2VfaXRlbV9CX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzAgAAAAljb25maXJtZWQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAfcHJpY2U6cHVyY2hhc2VfaXRlbV9CX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzBQAAAAVwcmljZQUAAAADbmlsAAAAADi0q3c=",
"height": 1926202,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: fBgUq79RwpNsiP2cjJUeaCjXfLFDNkA2sitkvUAw6YC
Next: Ep9U93YV2a9fT1RgEzz2BzJe56c1udwLtc4E9qJo17Vk
Diff:
Old | New | | Differences |
---|
27 | 27 | | |
---|
28 | 28 | | |
---|
29 | 29 | | @Callable(i) |
---|
30 | | - | func customerBuyB (amount,item) = { |
---|
| 30 | + | func customerBuyB (amount) = { |
---|
31 | 31 | | let pmt = extract(i.payment) |
---|
32 | 32 | | if (isDefined(pmt.assetId)) |
---|
33 | 33 | | then throw("Can use Waves only at the moment") |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func customerBuyA (amount) = { |
---|
8 | 8 | | let pmt = extract(i.payment) |
---|
9 | 9 | | if (isDefined(pmt.assetId)) |
---|
10 | 10 | | then throw("Can use Waves only at the moment") |
---|
11 | 11 | | else { |
---|
12 | 12 | | let customerAddress = toBase58String(i.caller.bytes) |
---|
13 | 13 | | let price = match getInteger(this, "item_A_coupon_price") { |
---|
14 | 14 | | case a: Int => |
---|
15 | 15 | | a |
---|
16 | 16 | | case _ => |
---|
17 | 17 | | 0 |
---|
18 | 18 | | } |
---|
19 | 19 | | if ((price > amount)) |
---|
20 | 20 | | then throw("Purchase amount cannot be less than item price") |
---|
21 | 21 | | else if ((amount > price)) |
---|
22 | 22 | | then throw("Purchase amount cannot be higher than item price") |
---|
23 | 23 | | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + customerAddress), price)]) |
---|
24 | 24 | | } |
---|
25 | 25 | | } |
---|
26 | 26 | | |
---|
27 | 27 | | |
---|
28 | 28 | | |
---|
29 | 29 | | @Callable(i) |
---|
30 | | - | func customerBuyB (amount,item) = { |
---|
| 30 | + | func customerBuyB (amount) = { |
---|
31 | 31 | | let pmt = extract(i.payment) |
---|
32 | 32 | | if (isDefined(pmt.assetId)) |
---|
33 | 33 | | then throw("Can use Waves only at the moment") |
---|
34 | 34 | | else { |
---|
35 | 35 | | let customerAddress = toBase58String(i.caller.bytes) |
---|
36 | 36 | | let price = match getInteger(this, "item_B_coupon_price") { |
---|
37 | 37 | | case a: Int => |
---|
38 | 38 | | a |
---|
39 | 39 | | case _ => |
---|
40 | 40 | | 0 |
---|
41 | 41 | | } |
---|
42 | 42 | | if ((price > amount)) |
---|
43 | 43 | | then throw("Purchase amount cannot be less than item price") |
---|
44 | 44 | | else if ((amount > price)) |
---|
45 | 45 | | then throw("Purchase amount cannot be higher than item price") |
---|
46 | 46 | | else WriteSet([DataEntry(("status:purchase_item_B_customer_" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_B_customer_" + customerAddress), price)]) |
---|
47 | 47 | | } |
---|
48 | 48 | | } |
---|
49 | 49 | | |
---|
50 | 50 | | |
---|