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