tx · bLx2cCH66mLenxm1FjSVXUMy6i7VkiF4FpZskaC2cmY
3MyHkEvUEjqLvmD1TUsRWkBb4DN6r9FpJ6B: -0.01000000 Waves
2019.07.03 05:35 [568643] smart account 3MyHkEvUEjqLvmD1TUsRWkBb4DN6r9FpJ6B > SELF 0.00000000 Waves
{
"type": 13,
"id": "bLx2cCH66mLenxm1FjSVXUMy6i7VkiF4FpZskaC2cmY",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1562121323552,
"version": 1,
"sender": "3MyHkEvUEjqLvmD1TUsRWkBb4DN6r9FpJ6B",
"senderPublicKey": "5gttUZSt4rfoxnfUN7j5bTFkrWzCqCws9ShQGXzwJXVi",
"proofs": [
"4zQquV4CGxPH4s5cQbsc3v1f67j8HX3jAMBu4XFX1k73DVdJVBfrWgL6NNBfXTWDph3TCaTYNQRcQcUqRjNnBm99"
],
"script": "base64:AAIDAAAAAAAAAAAAAAAAAAAAAQAAAAFpAQAAAAhwdXJjaGFzZQAAAAAEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAAApXYXZlcyBPbmx5BAAAAA9jdXN0b21lckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAFcHJpY2UEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwIAAAATaXRlbV9BX2NvdXBvbl9wcmljZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAwkAAGYAAAACBQAAAAVwcmljZQgFAAAAA3BtdAAAAAZhbW91bnQJAAACAAAAAQIAAAAHdG9vIGxvdwMJAABmAAAAAggFAAAAA3BtdAAAAAZhbW91bnQFAAAABXByaWNlCQAAAgAAAAECAAAACHRvbyBoaWdoCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAAIHN0YXR1czpwdXJjaGFzZV9pdGVtX0FfY3VzdG9tZXJfBQAAAA9jdXN0b21lckFkZHJlc3MCAAAACWNvbmZpcm1lZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAAB9wcmljZTpwdXJjaGFzZV9pdGVtX0FfY3VzdG9tZXJfBQAAAA9jdXN0b21lckFkZHJlc3MFAAAABXByaWNlBQAAAANuaWwAAAAA5ha4aw==",
"chainId": 84,
"height": 568643,
"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 | + | |
---|
| 5 | + | |
---|
| 6 | + | @Callable(a) |
---|
| 7 | + | func purchase () = { |
---|
| 8 | + | let b = extract(a.payment) |
---|
| 9 | + | if (isDefined(b.assetId)) |
---|
| 10 | + | then throw("Waves Only") |
---|
| 11 | + | else { |
---|
| 12 | + | let c = toBase58String(a.caller.bytes) |
---|
| 13 | + | let d = { |
---|
| 14 | + | let e = getInteger(this, "item_A_coupon_price") |
---|
| 15 | + | if ($isInstanceOf(e, "Int")) |
---|
| 16 | + | then { |
---|
| 17 | + | let f = e |
---|
| 18 | + | f |
---|
| 19 | + | } |
---|
| 20 | + | else 0 |
---|
| 21 | + | } |
---|
| 22 | + | if ((d > b.amount)) |
---|
| 23 | + | then throw("too low") |
---|
| 24 | + | else if ((b.amount > d)) |
---|
| 25 | + | then throw("too high") |
---|
| 26 | + | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + c), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + c), d)]) |
---|
| 27 | + | } |
---|
| 28 | + | } |
---|
| 29 | + | |
---|
| 30 | + | |
---|