tx · 4tu97ZGhAwgLeSrKKwKkcYCDn8XgGP39bekaHZ9q3FtD 3MyKo6Ke4sDkhxyjX68aD4sn2CuZG2WwMyJ: -0.01000000 Waves 2019.07.02 12:46 [567612] smart account 3MyKo6Ke4sDkhxyjX68aD4sn2CuZG2WwMyJ > SELF 0.00000000 Waves
{ "type": 13, "id": "4tu97ZGhAwgLeSrKKwKkcYCDn8XgGP39bekaHZ9q3FtD", "fee": 1000000, "feeAssetId": null, "timestamp": 1562060757267, "version": 1, "sender": "3MyKo6Ke4sDkhxyjX68aD4sn2CuZG2WwMyJ", "senderPublicKey": "5AAjC5BZXU4DyyYyipQ9H4oTZocxTn7aoAxmf1CKZ7rs", "proofs": [ "5HUhGpmNsu7EtzUpoKD1KCY2Svs1tiaRYAGMdhtcKW2iRpQZePzDwx5SD9uDMEYgvkqrYTzjDNeQt2ZApczW31RJ" ], "script": "base64:AAIDAAAAAAAAAAAAAAABAAAAAAtvd25lclB1YktleQEAAAAgPcf5TLCDY/ji3cwkHGXS2p8PGYrVkDzyh48lCrSWTSQAAAABAAAAAWkBAAAACHB1cmNoYXNlAAAAAQAAAARpdGVtBAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAgY2FuIHVzZSBXQVZFUyBvbmx5IGF0IHRoZSBtb21lbnQEAAAAD2N1c3RvbWVyQWRkcmVzcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAZwcmljZUEEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwIAAAATaXRlbV9BX2NvdXBvbl9wcmljZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAAZwcmljZUIEAAAAByRtYXRjaDAJAAQaAAAAAgU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3VzdG9tZXJfBQAAAA9jdXN0b21lckFkZHJlc3MFAAAABnByaWNlQgUAAAADbmlsAAAAAHV8GdE=", "chainId": 84, "height": 567612, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let ownerPubKey = base58'5AAjC5BZXU4DyyYyipQ9H4oTZocxTn7aoAxmf1CKZ7rs' | |
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func purchase (item) = { | |
8 | + | let pmt = extract(i.payment) | |
9 | + | if (isDefined(pmt.assetId)) | |
10 | + | then throw("can use WAVES only at the moment") | |
11 | + | else { | |
12 | + | let customerAddress = toBase58String(i.caller.bytes) | |
13 | + | let priceA = match getInteger(this, "item_A_coupon_price") { | |
14 | + | case a: Int => | |
15 | + | a | |
16 | + | case _ => | |
17 | + | 0 | |
18 | + | } | |
19 | + | let priceB = match getInteger(this, "item_B_coupon_price") { | |
20 | + | case a: Int => | |
21 | + | a | |
22 | + | case _ => | |
23 | + | 0 | |
24 | + | } | |
25 | + | if (if ((priceA > pmt.amount)) | |
26 | + | then true | |
27 | + | else (priceB > pmt.amount)) | |
28 | + | then throw("purchase amount cannot be less than item price") | |
29 | + | else if (if ((pmt.amount > priceA)) | |
30 | + | then true | |
31 | + | else (pmt.amount > priceB)) | |
32 | + | then throw("purchase amount cannot be higher than item price") | |
33 | + | else if ((item != "B")) | |
34 | + | then WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + customerAddress), priceA)]) | |
35 | + | else WriteSet([DataEntry(("status:purchase_item_B_customer_" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_B_customer_" + customerAddress), priceB)]) | |
36 | + | } | |
37 | + | } | |
38 | + | ||
39 | + |
github/deemru/w8io/169f3d6 21.24 ms ◑