tx · GDrbVJbkZduXWdtf84jhiQe9KhpmZgqDRARDL3eqvKDP 3PQLUs4aPzwvFhBupHgPPFjq6uFJZzniUxH: -1.00000000 Waves 2020.05.23 20:48 [2074716] smart asset 3PQLUs4aPzwvFhBupHgPPFjq6uFJZzniUxH > SELF 0 CloMinTok
{ "type": 15, "id": "GDrbVJbkZduXWdtf84jhiQe9KhpmZgqDRARDL3eqvKDP", "fee": 100000000, "feeAssetId": null, "timestamp": 1590256089782, "version": 1, "sender": "3PQLUs4aPzwvFhBupHgPPFjq6uFJZzniUxH", "senderPublicKey": "4yjws9gPpvT8qN8SattjH61SNmYJjSa8TPijnhAdLRfJ", "proofs": [ "3j4ivFR9NMevLcQZKymdhdGPWNYivZPv2PMzHxECNqRnV7obaEpzB2C1zLM2mKb46fiQLfBDF63hQvkoSBFEQ4wr" ], "assetId": "BW6epwtT5mJguAmc9NxzqRJshixC9bhDkFdnmsPr23fq", "script": "base64:AQQAAAALZEFwcEFkZHJlc3MJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNQUUxVczRhUHp3dkZoQnVwSGdQUEZqcTZ1Rkpaem5pVXhIBAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPQnVyblRyYW5zYWN0aW9uBAAAAAJ0eAUAAAAHJG1hdGNoMAkAAAAAAAACCAUAAAACdHgAAAAGc2VuZGVyBQAAAAtkQXBwQWRkcmVzcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAASUmVpc3N1ZVRyYW5zYWN0aW9uBAAAAAJ0eAUAAAAHJG1hdGNoMAkAAAAAAAACCAUAAAACdHgAAAAGc2VuZGVyBQAAAAtkQXBwQWRkcmVzcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAZU2V0QXNzZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAACdHgFAAAAByRtYXRjaDAJAAAAAAAAAggFAAAAAnR4AAAABnNlbmRlcgUAAAALZEFwcEFkZHJlc3MDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAF01hc3NUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAJ0eAUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAAnR4BQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATRXhjaGFuZ2VUcmFuc2FjdGlvbgQAAAABZQUAAAAHJG1hdGNoMAMJAQAAAAlpc0RlZmluZWQAAAABCAgIBQAAAAFlAAAACXNlbGxPcmRlcgAAAAlhc3NldFBhaXIAAAAKcHJpY2VBc3NldAkAAAIAAAABAgAAABNPbmx5IHdhdmVzIGFjY2VwdGVkBgeTixX/", "chainId": 87, "height": 2074716, "spentComplexity": 0 } View: original | compacted Prev: F7Zjte1UgsGcRdAVy8xN1w2CryQpN78Keh9FiTNY5AZV Next: CH5tGNQTJnNMQLHrFkMiHakuuvrP55zfEmGpumYPayNX Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 1 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | 3 | let dAppAddress = addressFromString("3PQLUs4aPzwvFhBupHgPPFjq6uFJZzniUxH") | |
4 | - | let adminPK = base58'4yjws9gPpvT8qN8SattjH61SNmYJjSa8TPijnhAdLRfJ' | |
5 | - | let startHeight = 2073000 | |
6 | - | let intervalHeight = 1300 | |
7 | - | let intervalPrice = 10000 | |
8 | - | let startPrice = 1000000 | |
9 | - | let days = ((height - startHeight) / intervalHeight) | |
10 | - | let sum = (startPrice + (intervalPrice * days)) | |
11 | - | let sellAmount = 1000 | |
12 | - | let sellPrice = (sum * 100000000) | |
13 | - | let buyPrice = ((sum - 50000) * 100000000) | |
14 | - | let sellPricee = (sellPrice / 100000000) | |
15 | - | let buyPricee = (buyPrice / 100000000) | |
16 | 4 | match tx { | |
17 | 5 | case tx: BurnTransaction => | |
18 | 6 | (tx.sender == dAppAddress) | |
21 | 9 | case tx: SetAssetScriptTransaction => | |
22 | 10 | (tx.sender == dAppAddress) | |
23 | 11 | case tx: MassTransferTransaction => | |
24 | - | | |
12 | + | true | |
25 | 13 | case tx: TransferTransaction => | |
26 | - | | |
14 | + | true | |
27 | 15 | case e: ExchangeTransaction => | |
28 | - | let sender = e.sellOrder.sender | |
29 | - | let sell = sigVerify(e.sellOrder.bodyBytes, e.sellOrder.proofs[0], e.sellOrder.senderPublicKey) | |
30 | - | let buy = sigVerify(e.buyOrder.bodyBytes, e.buyOrder.proofs[0], e.buyOrder.senderPublicKey) | |
31 | - | let admin = (e.sellOrder.sender == addressFromPublicKey(adminPK)) | |
32 | - | if (admin) | |
33 | - | then true | |
34 | - | else if (isDefined(e.sellOrder.assetPair.priceAsset)) | |
35 | - | then throw("Only waves accepted") | |
36 | - | else if (sell) | |
37 | - | then if ((sellAmount > e.sellOrder.amount)) | |
38 | - | then throw(((((("-= Sales must be greater than or equal to " + toString(sellAmount)) + " CloMinTok =-") + " -= Объем продажи должен быть больше или равно ") + toString(sellAmount)) + " CloMinTok =-")) | |
39 | - | else if ((sellPrice >= e.sellOrder.price)) | |
40 | - | then throw(((((("-= Selling price should be higher " + toString(sellPricee)) + " Wavelets =-") + " -= Цена продажи должна быть больше ") + toString(sellPricee)) + " Wavelets =-")) | |
41 | - | else if (((e.sellOrder.expiration - e.sellOrder.timestamp) >= 6000000)) | |
42 | - | then throw("-= The term of the order should not exceed 1 hour =- -= Срок ордера не должен превышать 1 час =-") | |
43 | - | else true | |
44 | - | else if (buy) | |
45 | - | then if ((buyPrice >= e.sellOrder.price)) | |
46 | - | then throw(((((("-= Purchase price must be higher " + toString(buyPricee)) + " Wavelets =-") + " -= Цена покупки должна быть больше ") + toString(buyPricee)) + " Wavelets =-")) | |
47 | - | else true | |
48 | - | else throw("something bad happened") | |
16 | + | if (isDefined(e.sellOrder.assetPair.priceAsset)) | |
17 | + | then throw("Only waves accepted") | |
18 | + | else true | |
49 | 19 | case _ => | |
50 | 20 | false | |
51 | 21 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 1 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | 3 | let dAppAddress = addressFromString("3PQLUs4aPzwvFhBupHgPPFjq6uFJZzniUxH") | |
4 | - | let adminPK = base58'4yjws9gPpvT8qN8SattjH61SNmYJjSa8TPijnhAdLRfJ' | |
5 | - | let startHeight = 2073000 | |
6 | - | let intervalHeight = 1300 | |
7 | - | let intervalPrice = 10000 | |
8 | - | let startPrice = 1000000 | |
9 | - | let days = ((height - startHeight) / intervalHeight) | |
10 | - | let sum = (startPrice + (intervalPrice * days)) | |
11 | - | let sellAmount = 1000 | |
12 | - | let sellPrice = (sum * 100000000) | |
13 | - | let buyPrice = ((sum - 50000) * 100000000) | |
14 | - | let sellPricee = (sellPrice / 100000000) | |
15 | - | let buyPricee = (buyPrice / 100000000) | |
16 | 4 | match tx { | |
17 | 5 | case tx: BurnTransaction => | |
18 | 6 | (tx.sender == dAppAddress) | |
19 | 7 | case tx: ReissueTransaction => | |
20 | 8 | (tx.sender == dAppAddress) | |
21 | 9 | case tx: SetAssetScriptTransaction => | |
22 | 10 | (tx.sender == dAppAddress) | |
23 | 11 | case tx: MassTransferTransaction => | |
24 | - | | |
12 | + | true | |
25 | 13 | case tx: TransferTransaction => | |
26 | - | | |
14 | + | true | |
27 | 15 | case e: ExchangeTransaction => | |
28 | - | let sender = e.sellOrder.sender | |
29 | - | let sell = sigVerify(e.sellOrder.bodyBytes, e.sellOrder.proofs[0], e.sellOrder.senderPublicKey) | |
30 | - | let buy = sigVerify(e.buyOrder.bodyBytes, e.buyOrder.proofs[0], e.buyOrder.senderPublicKey) | |
31 | - | let admin = (e.sellOrder.sender == addressFromPublicKey(adminPK)) | |
32 | - | if (admin) | |
33 | - | then true | |
34 | - | else if (isDefined(e.sellOrder.assetPair.priceAsset)) | |
35 | - | then throw("Only waves accepted") | |
36 | - | else if (sell) | |
37 | - | then if ((sellAmount > e.sellOrder.amount)) | |
38 | - | then throw(((((("-= Sales must be greater than or equal to " + toString(sellAmount)) + " CloMinTok =-") + " -= Объем продажи должен быть больше или равно ") + toString(sellAmount)) + " CloMinTok =-")) | |
39 | - | else if ((sellPrice >= e.sellOrder.price)) | |
40 | - | then throw(((((("-= Selling price should be higher " + toString(sellPricee)) + " Wavelets =-") + " -= Цена продажи должна быть больше ") + toString(sellPricee)) + " Wavelets =-")) | |
41 | - | else if (((e.sellOrder.expiration - e.sellOrder.timestamp) >= 6000000)) | |
42 | - | then throw("-= The term of the order should not exceed 1 hour =- -= Срок ордера не должен превышать 1 час =-") | |
43 | - | else true | |
44 | - | else if (buy) | |
45 | - | then if ((buyPrice >= e.sellOrder.price)) | |
46 | - | then throw(((((("-= Purchase price must be higher " + toString(buyPricee)) + " Wavelets =-") + " -= Цена покупки должна быть больше ") + toString(buyPricee)) + " Wavelets =-")) | |
47 | - | else true | |
48 | - | else throw("something bad happened") | |
16 | + | if (isDefined(e.sellOrder.assetPair.priceAsset)) | |
17 | + | then throw("Only waves accepted") | |
18 | + | else true | |
49 | 19 | case _ => | |
50 | 20 | false | |
51 | 21 | } |
github/deemru/w8io/6500d08 271.15 ms ◑