tx · 5SPMfKjknpBtWvAQAd8rB4Hvk1dneGbVi5btmqgfGVNz 3MozTr8r7fZ1siohKsJgDUBykyB3ZAmTXQz: -1.00000000 Waves 2019.09.13 01:23 [673537] smart asset 3MozTr8r7fZ1siohKsJgDUBykyB3ZAmTXQz > SELF 0.00000000 time3
{ "type": 15, "id": "5SPMfKjknpBtWvAQAd8rB4Hvk1dneGbVi5btmqgfGVNz", "fee": 100000000, "feeAssetId": null, "timestamp": 1568327033552, "version": 1, "sender": "3MozTr8r7fZ1siohKsJgDUBykyB3ZAmTXQz", "senderPublicKey": "8xbFEr8yZ5HF64v8tiadoqScjuYSatXx8ceugsivh1zn", "proofs": [ "2Pgp6SXMmHakhpiQvWBkENi4ATfmxLfUxAtjVtkxmTjrKNNeHjmJmXzqcSZ4Z2rdxbN9bstiwTvjPZhZNvREZtu1" ], "assetId": "J6C8iuvmPWE7erepvWeYQisAy6p2Wf1uYVB2cVqriC7", "script": "base64:AgQAAAATbWluaW11bVdhdmVzQmFsYW5jZQAAAAAAO5rKAAQAAAAQbW92ZVRpbWVJbkJsb2NrcwAAAAAAAAAAAgQAAAAQbWluaW1hbEZlZVRvTW92ZQAAAAAAAJiWgAQAAAAQbWluaW1hbEZlZVRvQnVybgAAAAAAAvrwgAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAAXQFAAAAByRtYXRjaDAEAAAABHR4SWQIBQAAAAF0AAAACmF0dGFjaG1lbnQEAAAAHGN1cnJlbnRSZWNpcGllbnRXYXZlc0JhbGFuY2UJAQAAAAx3YXZlc0JhbGFuY2UAAAABCAUAAAABdAAAAAlyZWNpcGllbnQEAAAAC3RyYW5zYWN0aW9uCQAD6AAAAAEJAQAAAAdleHRyYWN0AAAAAQgFAAAAAXQAAAAHYXNzZXRJZAQAAAAHJG1hdGNoMQUAAAALdHJhbnNhY3Rpb24DCQAAAQAAAAIFAAAABy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CAUAAAAHaXNzdWVUeAAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAARQmFkIGlzc3VlIHR4IHR5cGUJAAACAAAAAQIAAAAgWW91IG9ubHkgY2FuIHRyYW5zZmVyIHRoaXMgdG9rZW5+V97D", "chainId": 84, "height": 673537, "spentComplexity": 0 } View: original | compacted Prev: BAx1SGeVh7kgchwPoPjtqojvTMgTZGRpb1XwTZz6M5hg Next: H7KX4rq7gVeF7xNe6TybegJ6DXweqTzZp8xQz6f4yeUk Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 2 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | + | let minimumWavesBalance = 1000000000 | |
4 | + | let moveTimeInBlocks = 2 | |
5 | + | let minimalFeeToMove = 10000000 | |
6 | + | let minimalFeeToBurn = 50000000 | |
3 | 7 | match tx { | |
4 | 8 | case t: TransferTransaction => | |
5 | 9 | let txId = t.attachment | |
10 | + | let currentRecipientWavesBalance = wavesBalance(t.recipient) | |
6 | 11 | let transaction = transactionById(extract(t.assetId)) | |
7 | 12 | match transaction { | |
8 | 13 | case issueTx: IssueTransaction => | |
9 | 14 | let transactionByIssuer = (t.senderPublicKey == issueTx.senderPublicKey) | |
10 | - | let receiveTx = transactionById(txId) | |
11 | - | match receiveTx { | |
12 | - | case recTx: MassTransferTransaction|TransferTransaction => | |
13 | - | let receivedBlockNumber = extract(transactionHeightById(recTx.id)) | |
14 | - | let receivedAssetInLastNBlocks = (2 > (height - receivedBlockNumber)) | |
15 | - | if (!(receivedAssetInLastNBlocks)) | |
16 | - | then throw("You got potato long time ago, now you have to pay 1 WAVES fee") | |
17 | - | else if (receivedAssetInLastNBlocks) | |
18 | - | then true | |
19 | - | else if (!(transactionByIssuer)) | |
20 | - | then false | |
21 | - | else true | |
22 | - | case _ => | |
23 | - | throw("Receive tx should be a transfer") | |
24 | - | } | |
15 | + | if (transactionByIssuer) | |
16 | + | then if ((minimumWavesBalance > currentRecipientWavesBalance)) | |
17 | + | then throw("Current balance is less than minimalWavesBalance") | |
18 | + | else true | |
19 | + | else if ((32 > size(t.attachment))) | |
20 | + | then throw("Attachment should contain transaction id ") | |
21 | + | else { | |
22 | + | let receiveTx = transactionById(txId) | |
23 | + | match receiveTx { | |
24 | + | case recTx: MassTransferTransaction|TransferTransaction => | |
25 | + | let receivedBlockNumber = extract(transactionHeightById(recTx.id)) | |
26 | + | let receivedAssetInLastNBlocks = if ((moveTimeInBlocks >= (height - receivedBlockNumber))) | |
27 | + | then (t.assetId == recTx.assetId) | |
28 | + | else false | |
29 | + | let feeMore1Waves = (t.fee >= minimalFeeToMove) | |
30 | + | if (if (!(receivedAssetInLastNBlocks)) | |
31 | + | then !(feeMore1Waves) | |
32 | + | else false) | |
33 | + | then throw("You got potato long time ago, now you have to pay 1 WAVES fee") | |
34 | + | else if (receivedAssetInLastNBlocks) | |
35 | + | then true | |
36 | + | else feeMore1Waves | |
37 | + | case _ => | |
38 | + | throw("Receive tx should be a transfer") | |
39 | + | } | |
40 | + | } | |
25 | 41 | case _ => | |
26 | - | throw("Not issue") | |
42 | + | throw("Not issue tx") | |
43 | + | } | |
44 | + | case burn: BurnTransaction => | |
45 | + | if ((minimalFeeToBurn > burn.fee)) | |
46 | + | then throw("You have to pay 5 WAVES to burn this token") | |
47 | + | else true | |
48 | + | case mass: SetAssetScriptTransaction|MassTransferTransaction => | |
49 | + | let transaction = transactionById(extract(mass.assetId)) | |
50 | + | match transaction { | |
51 | + | case issueTx: IssueTransaction => | |
52 | + | (mass.senderPublicKey == issueTx.senderPublicKey) | |
53 | + | case _ => | |
54 | + | throw("Bad issue tx type") | |
27 | 55 | } | |
28 | 56 | case _ => | |
29 | - | | |
57 | + | throw("You only can transfer this token") | |
30 | 58 | } |
github/deemru/w8io/169f3d6 26.64 ms ◑