tx · Et4n3qHzA4SCLgzkmJZKwG2uGkAGXAtuRrXdoqRFyvyo
3N9g8vmJj171kPszhaCUyPDNfNPqaXiFP3Z: -0.04000000 Waves
2020.06.07 19:46 [1033133] smart account 3N9g8vmJj171kPszhaCUyPDNfNPqaXiFP3Z > SELF 0.00000000 Waves
{
"type": 13,
"id": "Et4n3qHzA4SCLgzkmJZKwG2uGkAGXAtuRrXdoqRFyvyo",
"fee": 4000000,
"feeAssetId": null,
"timestamp": 1591548486253,
"version": 1,
"sender": "3N9g8vmJj171kPszhaCUyPDNfNPqaXiFP3Z",
"senderPublicKey": "G4tSmURBD4HJkP9Q8xjQhetzYDb1J7Bc581de6M9V7AK",
"proofs": [
"3wE96Whk4EmWFYY9ghviJCS4XMXjtcSyR8NQYxnHEY4NhiejmtenWyn76N8KWTw3ArU8j5TjWB6aE5S2tFz2MANz"
],
"script": "base64:AAIDAAAAAAAAAAQIARIAAAAAAAAAAAEAAAABaQEAAAAIcHVyY2hhc2UAAAAABAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAgY2FuIHVzZSBXQVZFUyBvbmx5IGF0IHRoZSBtb21lbnQEAAAAD2N1c3RvbWVyQWRyZWVzcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAVwcmljZQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzAgAAABNJdGVtX0FfY291cG9uX3ByaWNlAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAADCQAAZgAAAAIFAAAABXByaWNlCAUAAAADcG10AAAABmFtb3VudAkAAAIAAAABAgAAAC5wdXJjaGFzZSBhbW91bnQgY2Fubm90IGJlIGxlc3MgdGhhbSBpdGVtIHByaWNlAwkAAGYAAAACCAUAAAADcG10AAAABmFtb3VudAUAAAAFcHJpY2UJAAACAAAAAQIAAAAwcHVyY2hhc2UgYW1vdW50IGNhbm5vdCBiZSBoaWdoZXIgdGhhbiBpdGVtIHByb2NlCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAAIHN0YXR1czpwdXJjaGFzZV9JdGVtX0FfY3VzdG9tZXJfBQAAAA9jdXN0b21lckFkcmVlc3MCAAAACWNvbmZpcm1lZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAAB9wcmljZTpwdXJjaGFzZV9JdGVtX0FfY3VzdG9tZXJfBQAAAA9jdXN0b21lckFkcmVlc3MFAAAABXByaWNlBQAAAANuaWwAAAAA8TRENQ==",
"chainId": 84,
"height": 1033133,
"spentComplexity": 0
}
View: original | compacted
Prev: zGKYXtPjHWS44vnEtqyaLaqzEVidpR2jnY682L6Pv2q
Next: 453BXrz1QG6PHXRauBiCTQrPvD31wkC4BueWemFRheBb
Diff:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let alicePubKey = base58'7ULo5c4qYG7K4Zy4SFTMGzYzQ8By2hXNHAZYmoQrHtpE' |
---|
5 | 4 | | |
---|
6 | | - | let bobPubKey = base58'G4tSmURBD4HJkP9Q8xjQhetzYDb1J7Bc581de6M9V7AK' |
---|
7 | | - | |
---|
8 | | - | let cooperPubKey = base58'B8P2fEVPKmbGP1deNKPcTxG9N3R9viSWrVdo3LiDjvkm' |
---|
9 | 5 | | |
---|
10 | 6 | | @Callable(i) |
---|
11 | 7 | | func purchase () = { |
---|
12 | 8 | | let pmt = extract(i.payment) |
---|
13 | 9 | | if (isDefined(pmt.assetId)) |
---|
14 | | - | then throw("can hodl WAVES only at the moment") |
---|
| 10 | + | then throw("can use WAVES only at the moment") |
---|
15 | 11 | | else { |
---|
16 | 12 | | let customerAdreess = toBase58String(i.caller.bytes) |
---|
17 | 13 | | let price = match getInteger(this, "Item_A_coupon_price") { |
---|
|
21 | 17 | | 0 |
---|
22 | 18 | | } |
---|
23 | 19 | | if ((price > pmt.amount)) |
---|
24 | | - | then throw("purchase amount cannot be less them item") |
---|
| 20 | + | then throw("purchase amount cannot be less tham item price") |
---|
25 | 21 | | else if ((pmt.amount > price)) |
---|
26 | | - | then throw("purchase amount cannot be higher them item") |
---|
| 22 | + | then throw("purchase amount cannot be higher than item proce") |
---|
27 | 23 | | else WriteSet([DataEntry(("status:purchase_Item_A_customer_" + customerAdreess), "confirmed"), DataEntry(("price:purchase_Item_A_customer_" + customerAdreess), price)]) |
---|
28 | 24 | | } |
---|
29 | 25 | | } |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let alicePubKey = base58'7ULo5c4qYG7K4Zy4SFTMGzYzQ8By2hXNHAZYmoQrHtpE' |
---|
5 | 4 | | |
---|
6 | | - | let bobPubKey = base58'G4tSmURBD4HJkP9Q8xjQhetzYDb1J7Bc581de6M9V7AK' |
---|
7 | | - | |
---|
8 | | - | let cooperPubKey = base58'B8P2fEVPKmbGP1deNKPcTxG9N3R9viSWrVdo3LiDjvkm' |
---|
9 | 5 | | |
---|
10 | 6 | | @Callable(i) |
---|
11 | 7 | | func purchase () = { |
---|
12 | 8 | | let pmt = extract(i.payment) |
---|
13 | 9 | | if (isDefined(pmt.assetId)) |
---|
14 | | - | then throw("can hodl WAVES only at the moment") |
---|
| 10 | + | then throw("can use WAVES only at the moment") |
---|
15 | 11 | | else { |
---|
16 | 12 | | let customerAdreess = toBase58String(i.caller.bytes) |
---|
17 | 13 | | let price = match getInteger(this, "Item_A_coupon_price") { |
---|
18 | 14 | | case a: Int => |
---|
19 | 15 | | a |
---|
20 | 16 | | case _ => |
---|
21 | 17 | | 0 |
---|
22 | 18 | | } |
---|
23 | 19 | | if ((price > pmt.amount)) |
---|
24 | | - | then throw("purchase amount cannot be less them item") |
---|
| 20 | + | then throw("purchase amount cannot be less tham item price") |
---|
25 | 21 | | else if ((pmt.amount > price)) |
---|
26 | | - | then throw("purchase amount cannot be higher them item") |
---|
| 22 | + | then throw("purchase amount cannot be higher than item proce") |
---|
27 | 23 | | else WriteSet([DataEntry(("status:purchase_Item_A_customer_" + customerAdreess), "confirmed"), DataEntry(("price:purchase_Item_A_customer_" + customerAdreess), price)]) |
---|
28 | 24 | | } |
---|
29 | 25 | | } |
---|
30 | 26 | | |
---|
31 | 27 | | |
---|