tx · DVmo7PRuTgxDJi95fC2kbqNMDshJKtB8a9NQGpD5prS6
3Mxc1WtkzRarwxjRG1VSTgoPPynuS3q196Y: -0.01000000 Waves
2021.07.06 16:13 [1601790] smart account 3Mxc1WtkzRarwxjRG1VSTgoPPynuS3q196Y > SELF 0.00000000 Waves
{
"type": 13,
"id": "DVmo7PRuTgxDJi95fC2kbqNMDshJKtB8a9NQGpD5prS6",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1625577235181,
"version": 2,
"chainId": 84,
"sender": "3Mxc1WtkzRarwxjRG1VSTgoPPynuS3q196Y",
"senderPublicKey": "9DTfiDzKQLuATT7gasgcj1kBn8VLJHjuBKJipCXbUJjr",
"proofs": [
"662a8YD4xnxwCjrindQemwLJsrfYepFMa7ABHK4RgATR44pQNzfmEyX69dy8o5MJfY2aRqt7hoXsXtDeF1Q3a4E8"
],
"script": "base64:AAIFAAAAAAAAAFQIAhIAGgcKAmExEgFpGgkKAmEyEgNwbXQaFQoCYTMSD2N1c3RvbWVyQWRkcmVzcxoLCgJhNBIFcHJpY2UaDQoCYTUSByRtYXRjaDAaBwoCYTYSAWEAAAAAAAAAAQAAAAJhMQEAAAAIcHVyY2hhc2UAAAAABAAAAAJhMgkAAZEAAAACCAUAAAACYTEAAAAIcGF5bWVudHMAAAAAAAAAAAADCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAAmEyAAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAVd29ya3Mgd2l0aCB3YXZlcyBvbmx5BAAAAAJhMwkAAlgAAAABCAgFAAAAAmExAAAABmNhbGxlcgAAAAVieXRlcwQAAAACYTQEAAAAAmE1CQAEGgAAAAIFAAAABHRoaXMCAAAAE2l0ZW1fQV9jb3Vwb25fcHJpY2UDCQAAAQAAAAIFAAAAAmE1AgAAAANJbnQEAAAAAmE2BQAAAAJhNQUAAAACYTYAAAAAAAAAAAADCQAAZgAAAAIFAAAAAmE0CAUAAAACYTIAAAAGYW1vdW50CQAAAgAAAAECAAAABGJsYWQDCQAAZgAAAAIIBQAAAAJhMgAAAAZhbW91bnQFAAAAAmE0CQAAAgAAAAECAAAADWJsYWQyIHphIGR1em8JAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACAgAAACBzdGF0dXM6cHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAACYTMCAAAACWNvbmZpcm1lZAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAB9wcmljZTpwdXJjaGFzZV9pdGVtX0FfY3VzdG9tZXJfBQAAAAJhMwUAAAACYTQFAAAAA25pbAAAAACWc3s+",
"height": 1601790,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: none
Next: 5VrZMaGG3HJLVzNcSwUw1z3i3wpfR8UVLFi5A7D6wwm
Full:
Old | New | | Differences |
---|
1 | | - | # no script |
---|
| 1 | + | {-# STDLIB_VERSION 5 #-} |
---|
| 2 | + | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
| 3 | + | {-# CONTENT_TYPE DAPP #-} |
---|
| 4 | + | |
---|
| 5 | + | |
---|
| 6 | + | @Callable(i) |
---|
| 7 | + | func purchase () = { |
---|
| 8 | + | let pmt = i.payments[0] |
---|
| 9 | + | if (isDefined(pmt.assetId)) |
---|
| 10 | + | then throw("works with waves only") |
---|
| 11 | + | else { |
---|
| 12 | + | let customerAddress = toBase58String(i.caller.bytes) |
---|
| 13 | + | let price = match getInteger(this, "item_A_coupon_price") { |
---|
| 14 | + | case a: Int => |
---|
| 15 | + | a |
---|
| 16 | + | case _ => |
---|
| 17 | + | 0 |
---|
| 18 | + | } |
---|
| 19 | + | if ((price > pmt.amount)) |
---|
| 20 | + | then throw("blad") |
---|
| 21 | + | else if ((pmt.amount > price)) |
---|
| 22 | + | then throw("blad2 za duzo") |
---|
| 23 | + | else [StringEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), IntegerEntry(("price:purchase_item_A_customer_" + customerAddress), price)] |
---|
| 24 | + | } |
---|
| 25 | + | } |
---|
| 26 | + | |
---|
| 27 | + | |
---|