tx · 7mCgN8p7WDWwMPHFxmcs1dvJWfRjiafWZiMQPbeSg79m
3N4T8eVemVK3f4E8KZgbwvBpk8csem2bFyb: -1.00000000 Waves
2019.03.16 13:15 [538584] smart asset 3N4T8eVemVK3f4E8KZgbwvBpk8csem2bFyb > SELF 0.00000000 ZAraa
{
"type": 15,
"id": "7mCgN8p7WDWwMPHFxmcs1dvJWfRjiafWZiMQPbeSg79m",
"fee": 100000000,
"feeAssetId": null,
"timestamp": 1552731377765,
"version": 1,
"sender": "3N4T8eVemVK3f4E8KZgbwvBpk8csem2bFyb",
"senderPublicKey": "6XtTAMMi9snEs1mN1TBpR3npxA2R16FMxneyWXMZdMdf",
"proofs": [
"2nqcszR7wVEPT7THwHTUvfVESZbuNMHBNxjXdZrw54dRCeNM2XgN8cf8UXJUhHMm2yC9hV75SRQFPL1BTdtB7dvE"
],
"assetId": "6uTUhCBEKUcWVxKz8sHJ2oh616PmmGPMFV1cr2Hx9Ggu",
"script": "base64:AgQAAAAGaXNzdWVyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUn3ENnb2h8+cM5MoAZuZG+9HctthQtzPqBAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATRXhjaGFuZ2VUcmFuc2FjdGlvbgQAAAACdHgFAAAAByRtYXRjaDAEAAAABHNlbGwJAAH0AAAAAwgIBQAAAAJ0eAAAAAlzZWxsT3JkZXIAAAAJYm9keUJ5dGVzCQABkQAAAAIICAUAAAACdHgAAAAJc2VsbE9yZGVyAAAABnByb29mcwAAAAAAAAAAAAgIBQAAAAJ0eAAAAAlzZWxsT3JkZXIAAAAPc2VuZGVyUHVibGljS2V5BAAAAANidXkJAAH0AAAAAwgIBQAAAAJ0eAAAAAhidXlPcmRlcgAAAAlib2R5Qnl0ZXMJAAGRAAAAAggIBQAAAAJ0eAAAAAhidXlPcmRlcgAAAAZwcm9vZnMAAAAAAAAAAAAICAUAAAACdHgAAAAIYnV5T3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aW9uBAAAAAJ0eAUAAAAHJG1hdGNoMAMJAAAAAAAAAggFAAAAAnR4AAAABnNlbmRlcgUAAAAGaXNzdWVyBgkAAAIAAAABAgAAADZZb3UgY2Fubm90IHNlbmQgdGhpcyBhc3NldCB2aWEgTWFzc1RyYW5zZmVyVHJhbnNhY3Rpb24DCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0J1cm5UcmFuc2FjdGlvbgQAAAACdHgFAAAAByRtYXRjaDADCQAAAAAAAAIIBQAAAAJ0eAAAAAZzZW5kZXIFAAAABmlzc3VlcgYJAAACAAAAAQIAAAAaWW91IGNhbm5vdCBidXJuIHRoaXMgYXNzZXQDAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABJSZWlzc3VlVHJhbnNhY3Rpb24GCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAGVNldEFzc2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAnR4BQAAAAckbWF0Y2gwBgemlQop",
"chainId": 84,
"height": 538584,
"spentComplexity": 0
}
View: original | compacted
Prev: 3vX1pp9FXg3tcXjzdkza96gzzuxrwJ1KEB5D4VohuQRp
Next: 6XoAwBtiUcL9bgbJrvLwyi9SJAdcNtVSju298cyCYca3
Diff:
Old | New | | Differences |
---|
2 | 2 | | {-# CONTENT_TYPE EXPRESSION #-} |
---|
3 | 3 | | let issuer = Address(base58'3N4T8eVemVK3f4E8KZgbwvBpk8csem2bFyb') |
---|
4 | 4 | | match tx { |
---|
5 | | - | case tx: TransferTransaction => |
---|
6 | | - | let recipient = toBase58String(addressFromRecipient(tx.recipient).bytes) |
---|
7 | | - | let recipientCategory = getString(issuer, recipient) |
---|
8 | | - | if ((tx.sender == issuer)) |
---|
9 | | - | then true |
---|
10 | | - | else if (if (isDefined(recipientCategory)) |
---|
11 | | - | then (extract(recipientCategory) == "ambassador") |
---|
12 | | - | else false) |
---|
13 | | - | then true |
---|
14 | | - | else throw("This asset can be transferred to whitelist only") |
---|
15 | 5 | | case tx: ExchangeTransaction => |
---|
16 | 6 | | let sell = sigVerify(tx.sellOrder.bodyBytes, tx.sellOrder.proofs[0], tx.sellOrder.senderPublicKey) |
---|
17 | 7 | | let buy = sigVerify(tx.buyOrder.bodyBytes, tx.buyOrder.proofs[0], tx.buyOrder.senderPublicKey) |
---|
|
19 | 9 | | let buyOrderSender = toBase58String(tx.sellOrder.sender.bytes) |
---|
20 | 10 | | let sellOrderSenderCategory = getString(issuer, sellOrderSender) |
---|
21 | 11 | | let buyOrderSenderCategory = getString(issuer, buyOrderSender) |
---|
22 | | - | if (if (buy) |
---|
| 12 | + | if (if (if (buy) |
---|
23 | 13 | | then if (if (isDefined(buyOrderSenderCategory)) |
---|
24 | 14 | | then (extract(sellOrderSenderCategory) == "ambassador") |
---|
25 | 15 | | else false) |
---|
|
33 | 23 | | else false) |
---|
34 | 24 | | then true |
---|
35 | 25 | | else throw("Only whitelist can sell this asset") |
---|
| 26 | + | else false) |
---|
| 27 | + | then true |
---|
| 28 | + | else if (sell) |
---|
| 29 | + | then if ((tx.sellOrder.amount > 60)) |
---|
| 30 | + | then true |
---|
| 31 | + | else throw("Min sell ammount = 60") |
---|
36 | 32 | | else false |
---|
37 | 33 | | case tx: MassTransferTransaction => |
---|
38 | 34 | | if ((tx.sender == issuer)) |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 2 #-} |
---|
2 | 2 | | {-# CONTENT_TYPE EXPRESSION #-} |
---|
3 | 3 | | let issuer = Address(base58'3N4T8eVemVK3f4E8KZgbwvBpk8csem2bFyb') |
---|
4 | 4 | | match tx { |
---|
5 | | - | case tx: TransferTransaction => |
---|
6 | | - | let recipient = toBase58String(addressFromRecipient(tx.recipient).bytes) |
---|
7 | | - | let recipientCategory = getString(issuer, recipient) |
---|
8 | | - | if ((tx.sender == issuer)) |
---|
9 | | - | then true |
---|
10 | | - | else if (if (isDefined(recipientCategory)) |
---|
11 | | - | then (extract(recipientCategory) == "ambassador") |
---|
12 | | - | else false) |
---|
13 | | - | then true |
---|
14 | | - | else throw("This asset can be transferred to whitelist only") |
---|
15 | 5 | | case tx: ExchangeTransaction => |
---|
16 | 6 | | let sell = sigVerify(tx.sellOrder.bodyBytes, tx.sellOrder.proofs[0], tx.sellOrder.senderPublicKey) |
---|
17 | 7 | | let buy = sigVerify(tx.buyOrder.bodyBytes, tx.buyOrder.proofs[0], tx.buyOrder.senderPublicKey) |
---|
18 | 8 | | let sellOrderSender = toBase58String(tx.sellOrder.sender.bytes) |
---|
19 | 9 | | let buyOrderSender = toBase58String(tx.sellOrder.sender.bytes) |
---|
20 | 10 | | let sellOrderSenderCategory = getString(issuer, sellOrderSender) |
---|
21 | 11 | | let buyOrderSenderCategory = getString(issuer, buyOrderSender) |
---|
22 | | - | if (if (buy) |
---|
| 12 | + | if (if (if (buy) |
---|
23 | 13 | | then if (if (isDefined(buyOrderSenderCategory)) |
---|
24 | 14 | | then (extract(sellOrderSenderCategory) == "ambassador") |
---|
25 | 15 | | else false) |
---|
26 | 16 | | then true |
---|
27 | 17 | | else throw("Only whitelist can buy this asset") |
---|
28 | 18 | | else false) |
---|
29 | 19 | | then true |
---|
30 | 20 | | else if (sell) |
---|
31 | 21 | | then if (if (isDefined(sellOrderSenderCategory)) |
---|
32 | 22 | | then (extract(sellOrderSenderCategory) == "ambassador") |
---|
33 | 23 | | else false) |
---|
34 | 24 | | then true |
---|
35 | 25 | | else throw("Only whitelist can sell this asset") |
---|
| 26 | + | else false) |
---|
| 27 | + | then true |
---|
| 28 | + | else if (sell) |
---|
| 29 | + | then if ((tx.sellOrder.amount > 60)) |
---|
| 30 | + | then true |
---|
| 31 | + | else throw("Min sell ammount = 60") |
---|
36 | 32 | | else false |
---|
37 | 33 | | case tx: MassTransferTransaction => |
---|
38 | 34 | | if ((tx.sender == issuer)) |
---|
39 | 35 | | then true |
---|
40 | 36 | | else throw("You cannot send this asset via MassTransferTransaction") |
---|
41 | 37 | | case tx: BurnTransaction => |
---|
42 | 38 | | if ((tx.sender == issuer)) |
---|
43 | 39 | | then true |
---|
44 | 40 | | else throw("You cannot burn this asset") |
---|
45 | 41 | | case tx: ReissueTransaction|SetAssetScriptTransaction => |
---|
46 | 42 | | true |
---|
47 | 43 | | case _ => |
---|
48 | 44 | | false |
---|
49 | 45 | | } |
---|