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