tx · FbJMNP2pZ4MC7Hoq9hfgRQBQvfFqrGe1pDr9d5ZZjLta 3Mrhtzv9KEtjx4mG47oxgjahHKW33oTntEV: -1.00400000 Waves 2019.08.08 18:41 [622176] smart asset 3Mrhtzv9KEtjx4mG47oxgjahHKW33oTntEV > SELF 0.000000 TXRP
{ "type": 15, "id": "FbJMNP2pZ4MC7Hoq9hfgRQBQvfFqrGe1pDr9d5ZZjLta", "fee": 100400000, "feeAssetId": null, "timestamp": 1565278821039, "version": 1, "sender": "3Mrhtzv9KEtjx4mG47oxgjahHKW33oTntEV", "senderPublicKey": "DANkK8NJhJ9K7AHbve8QzKkbyvJzr5pbttLhba7d9BGm", "proofs": [ "WffFQKsG2QBNC2stgrj4mNhsDPunniUFHZ14Bxp658YLjXFVe4uMQX2yo17wzsYW1i6c9NddJ77J96USd22jW6F" ], "assetId": "HUdXNRE4VcCx64PCPYwh6KL2cxvRaKcR8bXe3Ar9fG4p", "script": "base64:AwQAAAAObWF0Y2hlckFkZHJlc3MJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNNczhmU2ZBeEJMRGpLdk5WZ0FDUnpRb0JMQ3RDV3h0YXd1BAAAABBtYXRjaGVyUHVibGljS2V5AQAAACBThDuRiQKq/0TcMlLglZN11ZQJlziVeFsi3R5LSjzVTwQAAAAOZ2F0ZXdheUFkZHJlc3MJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNNcmh0enY5S0V0ang0bUc0N294Z2phaEhLVzMzb1RudEVWBAAAABB3aGl0ZWxpc3RBZGRyZXNzCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABAgAAACMzTjZEd1d4VDgybkdKVXdCd2Q3TDUxNHIydTcxZ3I3V2h3SgQAAAAUZEFwcFdoaXRlbGlzdEFkZHJlc3MJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVR+ZQJfWyfFbW//7FjY3Cz3zzwo/8TmrxYEAAAAGmdhdGV3YXlDb250cm9sQX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92ZXJhbGwDCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABBQAAABZ3aGl0ZTFMaXN0T3ZlcmFsbEVudHJ5BgQAAAALY3VyMUJhbGFuY2UJAAPrAAAAAggFAAAAAnR4AAAABnNlbmRlcgUAAAAHYXNzZXRJZAMJAABmAAAAAgkBAAAAB2V4dHJhY3QAAAABBQAAABZ3aGl0ZTFMaXN0T3ZlcmFsbEVudHJ5CQAAZQAAAAIFAAAAC2N1cjFCYWxhbmNlCAUAAAAHcGF5bWVudAAAAAZhbW91bnQJAAACAAAAAQIAAAAjVW5hYmxlIHRvIHNlbmQgc3VjaCBhbW91bnQgKHR5cGU9MSkGBAAAAAtjdXIxQmFsYW5jZQkAA+sAAAACCAUAAAACdHgAAAAGc2VuZGVyBQAAAAdhc3NldElkAwkAAGYAAAACCQEAAAAHZXh0cmFjdAAAAAEFAAAAFHdoaXRlMUxpc3RBc3NldEVudHJ5CQAAZQAAAAIFAAAAC2N1cjFCYWxhbmNlCAUAAAAHcGF5bWVudAAAAAZhbW91bnQJAAACAAAAAQIAAAAjVW5hYmxlIHRvIHNlbmQgc3VjaCBhbW91bnQgKHR5cGU9MikGBwfNUMWy", "chainId": 84, "height": 622176, "spentComplexity": 0 } View: original | compacted Prev: GMMhKUU76PpgDBTWs7PaEVDBitEAsfHGuTkncsMvEvao Next: pKJSXnDaCsdg8LkY5etmdcE2xBwksHf9738VYHZTSzb Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | 3 | let matcherAddress = addressFromString("3Ms8fSfAxBLDjKvNVgACRzQoBLCtCWxtawu") | |
4 | 4 | let matcherPublicKey = base58'6d1nbhBxLCxjUyL9xXcX2VVxj2kcKiYny7VqH4FwbApv' | |
5 | 5 | let gatewayAddress = addressFromString("3Mrhtzv9KEtjx4mG47oxgjahHKW33oTntEV") | |
6 | 6 | let whitelistAddress = addressFromString("3N6DwWxT82nGJUwBwd7L514r2u71gr7WhwJ") | |
7 | 7 | let dAppWhitelistAddress = Address(base58'3N1SPvLZgv6FMfe5WNUtnPzt3okYxcJhYnR') | |
8 | 8 | let gatewayControlAssetAddress = base58'3w8UGTKzu3YvwRrvWeDuXkUVxdg1RuX1VCy6QRw86Fw4' | |
9 | 9 | let pAddress1 = addressFromString("3NCVDaT1ASbRd42hBSw4EG6ojGVRGtvMiz1") | |
10 | 10 | let pAddress2 = addressFromString("3Ms2kTAxdrcXDxwedfbNjSi6ewGCUqt3heZ") | |
11 | 11 | let pAddress3 = addressFromString("3N6ognm7xnQSFiownS1Df1LacJUQXvfDFLe") | |
12 | 12 | let pAddress4 = addressFromString("3MtVCmN9MZbWf9qxiMFoEPBrdc2fLp3SvuC") | |
13 | 13 | let pAddress5 = addressFromString("3MuWG8gsTK4RQBsm97sMCuUXW99JvRxwYSg") | |
14 | 14 | let validState = 1000 | |
15 | 15 | let ver = "2.0.0-testnet" | |
16 | 16 | match tx { | |
17 | 17 | case tx: MassTransferTransaction => | |
18 | 18 | false | |
19 | 19 | case tx: TransferTransaction => | |
20 | 20 | let isDAppAllowed = match getInteger(dAppWhitelistAddress, toBase58String(tx.sender.bytes)) { | |
21 | 21 | case a: Int => | |
22 | 22 | a | |
23 | 23 | case _ => | |
24 | 24 | -255 | |
25 | 25 | } | |
26 | 26 | if ((isDAppAllowed != -255)) | |
27 | 27 | then true | |
28 | 28 | else if (if ((tx.sender != gatewayAddress)) | |
29 | 29 | then (tx.recipient != gatewayAddress) | |
30 | 30 | else false) | |
31 | 31 | then throw("Only transactions with a gateway are allowed") | |
32 | 32 | else if ((tx.sender == gatewayAddress)) | |
33 | 33 | then true | |
34 | 34 | else { | |
35 | 35 | let white1List = toBase58String(tx.sender.bytes) | |
36 | 36 | let assetTxt = toBase58String(extract(tx.assetId)) | |
37 | 37 | let white1ListAsset = ((white1List + "_") + assetTxt) | |
38 | 38 | let white1ListOverall = ("res_" + assetTxt) | |
39 | 39 | let white1ListEntry = getInteger(extract(whitelistAddress), white1List) | |
40 | 40 | if (!(isDefined(white1ListEntry))) | |
41 | 41 | then throw("The sender's address is not in the white list") | |
42 | 42 | else if ((white1ListEntry != validState)) | |
43 | 43 | then throw("Sender is not in valid state") | |
44 | 44 | else { | |
45 | 45 | let white1ListAssetEntry = getInteger(extract(whitelistAddress), white1ListAsset) | |
46 | 46 | if (!(isDefined(white1ListAssetEntry))) | |
47 | 47 | then { | |
48 | 48 | let white1ListOverallEntry = getInteger(extract(whitelistAddress), white1ListOverall) | |
49 | 49 | if (!(isDefined(white1ListOverallEntry))) | |
50 | 50 | then true | |
51 | 51 | else { | |
52 | 52 | let cur1Balance = assetBalance(tx.sender, tx.assetId) | |
53 | 53 | if ((extract(white1ListOverallEntry) > (cur1Balance - tx.amount))) | |
54 | 54 | then throw("Unable to send such amount (type=1)") | |
55 | 55 | else true | |
56 | 56 | } | |
57 | 57 | } | |
58 | 58 | else { | |
59 | 59 | let cur1Balance = assetBalance(tx.sender, tx.assetId) | |
60 | 60 | if ((extract(white1ListAssetEntry) > (cur1Balance - tx.amount))) | |
61 | 61 | then throw("Unable to send such amount (type=2)") | |
62 | 62 | else true | |
63 | 63 | } | |
64 | 64 | } | |
65 | 65 | } | |
66 | 66 | case tx: ExchangeTransaction => | |
67 | 67 | if ((tx.sender != matcherAddress)) | |
68 | 68 | then throw("Incorrect matcher address") | |
69 | 69 | else { | |
70 | 70 | let outcoming1Account = tx.buyOrder.sender | |
71 | 71 | let outcoming2Account = tx.sellOrder.sender | |
72 | 72 | let white1List = toBase58String(outcoming1Account.bytes) | |
73 | 73 | let white2List = toBase58String(outcoming2Account.bytes) | |
74 | 74 | let white1ListEntry = getInteger(extract(whitelistAddress), toBase58String(outcoming1Account.bytes)) | |
75 | 75 | let white2ListEntry = getInteger(extract(whitelistAddress), toBase58String(outcoming2Account.bytes)) | |
76 | 76 | if (!(isDefined(white1ListEntry))) | |
77 | 77 | then throw((("User " + white1List) + " not in white list")) | |
78 | 78 | else if ((white1ListEntry != validState)) | |
79 | 79 | then throw((("User " + white1List) + " not in valid state")) | |
80 | 80 | else if (!(isDefined(white2ListEntry))) | |
81 | 81 | then throw((("User " + white2List) + " not in white list")) | |
82 | 82 | else if ((white2ListEntry != validState)) | |
83 | 83 | then throw((("User " + white2List) + " not in valid state")) | |
84 | 84 | else true | |
85 | 85 | } | |
86 | 86 | case tx: SetAssetScriptTransaction => | |
87 | 87 | let pKey1Signed = if (isDefined(getInteger(extract(pAddress1), toBase58String(tx.id)))) | |
88 | 88 | then 1 | |
89 | 89 | else 0 | |
90 | 90 | let pKey2Signed = if (isDefined(getInteger(extract(pAddress2), toBase58String(tx.id)))) | |
91 | 91 | then 1 | |
92 | 92 | else 0 | |
93 | 93 | let pKey3Signed = if (isDefined(getInteger(extract(pAddress3), toBase58String(tx.id)))) | |
94 | 94 | then 1 | |
95 | 95 | else 0 | |
96 | 96 | let pKey4Signed = if (isDefined(getInteger(extract(pAddress4), toBase58String(tx.id)))) | |
97 | 97 | then 1 | |
98 | 98 | else 0 | |
99 | 99 | let pKey5Signed = if (isDefined(getInteger(extract(pAddress5), toBase58String(tx.id)))) | |
100 | 100 | then 1 | |
101 | 101 | else 0 | |
102 | 102 | (((((pKey1Signed + pKey2Signed) + pKey3Signed) + pKey4Signed) + pKey5Signed) >= 3) | |
103 | 103 | case tx: BurnTransaction => | |
104 | 104 | (tx.sender == gatewayAddress) | |
105 | 105 | case tx: ReissueTransaction => | |
106 | 106 | (tx.sender == gatewayAddress) | |
107 | 107 | case tx: InvokeScriptTransaction => | |
108 | 108 | let isDAppAllowed = match getInteger(dAppWhitelistAddress, toBase58String(addressFromRecipient(tx.dApp).bytes)) { | |
109 | 109 | case a: Int => | |
110 | 110 | a | |
111 | 111 | case _ => | |
112 | 112 | -255 | |
113 | 113 | } | |
114 | 114 | if ((isDAppAllowed != -255)) | |
115 | 115 | then { | |
116 | 116 | let white1List = toBase58String(tx.sender.bytes) | |
117 | 117 | let isPaymentExist = match tx.payment { | |
118 | 118 | case a: AttachedPayment => | |
119 | 119 | true | |
120 | 120 | case _ => | |
121 | 121 | false | |
122 | 122 | } | |
123 | 123 | if ((isPaymentExist == false)) | |
124 | 124 | then true | |
125 | 125 | else { | |
126 | 126 | let payment = extract(tx.payment) | |
127 | 127 | let assetId = extract(payment.assetId) | |
128 | 128 | let assetTxt = toBase58String(assetId) | |
129 | 129 | let white1ListAsset = ((white1List + "_") + assetTxt) | |
130 | 130 | let white1ListOverall = ("res_" + assetTxt) | |
131 | 131 | let white1ListEntry = getInteger(extract(whitelistAddress), white1List) | |
132 | 132 | if (!(isDefined(white1ListEntry))) | |
133 | 133 | then throw("The sender's address is not in the white list") | |
134 | 134 | else if ((white1ListEntry != validState)) | |
135 | 135 | then throw("Sender is not in valid state") | |
136 | 136 | else { | |
137 | 137 | let white1ListAssetEntry = getInteger(extract(whitelistAddress), white1ListAsset) | |
138 | 138 | if (!(isDefined(white1ListAssetEntry))) | |
139 | 139 | then { | |
140 | 140 | let white1ListOverallEntry = getInteger(extract(whitelistAddress), white1ListOverall) | |
141 | 141 | if (!(isDefined(white1ListOverallEntry))) | |
142 | 142 | then true | |
143 | 143 | else { | |
144 | 144 | let cur1Balance = assetBalance(tx.sender, assetId) | |
145 | 145 | if ((extract(white1ListOverallEntry) > (cur1Balance - payment.amount))) | |
146 | 146 | then throw("Unable to send such amount (type=1)") | |
147 | 147 | else true | |
148 | 148 | } | |
149 | 149 | } | |
150 | 150 | else { | |
151 | 151 | let cur1Balance = assetBalance(tx.sender, assetId) | |
152 | 152 | if ((extract(white1ListAssetEntry) > (cur1Balance - payment.amount))) | |
153 | 153 | then throw("Unable to send such amount (type=2)") | |
154 | 154 | else true | |
155 | 155 | } | |
156 | 156 | } | |
157 | 157 | } | |
158 | 158 | } | |
159 | 159 | else false | |
160 | 160 | case _ => | |
161 | 161 | false | |
162 | 162 | } |
github/deemru/w8io/169f3d6 45.91 ms ◑