tx · HKLmM8p6j2TP74trwWfbvXHtHMQb7VHsqrF7A7hnU3Dz 3Mx66EFd8iB1tZ6vu7Xx5GMkzbKQc3Nrw81: -0.01400000 Waves 2020.08.11 06:14 [1127293] smart account 3Mx66EFd8iB1tZ6vu7Xx5GMkzbKQc3Nrw81 > SELF 0.00000000 Waves
{ "type": 13, "id": "HKLmM8p6j2TP74trwWfbvXHtHMQb7VHsqrF7A7hnU3Dz", "fee": 1400000, "feeAssetId": null, "timestamp": 1597115653433, "version": 1, "sender": "3Mx66EFd8iB1tZ6vu7Xx5GMkzbKQc3Nrw81", "senderPublicKey": "7F9WJ2MEaCQTxjwqCQmL9jHicqJVc3uCmntzCMAK8yq6", "proofs": [ "2w9akdk7oNzvPaLeosp2HsMZVBfEjRyfL8upUbrJx2dGpj4g6y5FxSfx5gTbKePvgN3GQuBTJh3fWqjqJXy9Zbtj" ], "script": "base64:AwQAAAAETk9ORQIAAAAEbm9uZQQAAAALdXNlcnNQdWJLZXkBAAAAIKeP6tgl4CP2PWCZbTcLVLGPExrT9u/W4PAFsxrOIcYHBAAAAAl1c2Vyc0FkZHIJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEFAAAAC3VzZXJzUHViS2V5BAAAAARidG5zAQAAACDFLOWBobFDqtyu6bkFDRsq16C369fJHs5Bnyp0LEWdcwQAAAAEYnRuZgEAAAAgAcfavlePt+AR+muoBefYqFrjn0Oc5fUH1esIaonljXkKAQAAAAh2ZXJpZmllcgAAAAEAAAAHYWNjb3VudAMJAAAAAAAAAgUAAAAHYWNjb3VudAUAAAAEdGhpcwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAA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JAQAAAAh2ZXJpZmllcgAAAAEFAAAACXVzZXJzQWRkcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAXMFAAAAByRtYXRjaDAJAQAAAAh2ZXJpZmllcgAAAAEFAAAACXVzZXJzQWRkcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAQTGVhc2VUcmFuc2FjdGlvbgQAAAABbAUAAAAHJG1hdGNoMAkBAAAAF2FsbG93ZWRBZGRyU3BvbnNvcmVkRmVlAAAAAQkABCQAAAABCAUAAAABbAAAAAlyZWNpcGllbnQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFkxlYXNlQ2FuY2VsVHJhbnNhY3Rpb24EAAAAAWMFAAAAByRtYXRjaDAJAQAAAAh2ZXJpZmllcgAAAAEFAAAABHRoaXMHwMMkrg==", "chainId": 84, "height": 1127293, "spentComplexity": 0 } View: original | compacted Prev: 5twJFXGwSjpeDxaLD8gjfhJoQMTWHszECnAqH2gQK2Hs Next: 5AWatfQN9gR7KuJqPfzm1aqKjHh2Wwhx5WSUfpdNh3yf Diff:
Old | New | Differences | |
---|---|---|---|
46 | 46 | then (b != a) | |
47 | 47 | else false) | |
48 | 48 | then true | |
49 | - | else | |
49 | + | else throw(("trava em" + b)) | |
50 | 50 | ||
51 | 51 | func allowedTransferTokens (assetId) = { | |
52 | 52 | let tokensIdList = split(getStringValue(addressFromPublicKey(usersPubKey), "allowedTransfers"), ",") | |
53 | 53 | let contain = { | |
54 | - | let $ | |
55 | - | let $ | |
56 | - | let $ | |
57 | - | if (($ | |
58 | - | then $ | |
54 | + | let $list14781549 = tokensIdList | |
55 | + | let $size14781549 = size($list14781549) | |
56 | + | let $acc014781549 = toBase58String(extract(assetId)) | |
57 | + | if (($size14781549 == 0)) | |
58 | + | then $acc014781549 | |
59 | 59 | else { | |
60 | - | let $ | |
61 | - | if (($ | |
62 | - | then $ | |
60 | + | let $acc114781549 = containTokenId($acc014781549, $list14781549[0]) | |
61 | + | if (($size14781549 == 1)) | |
62 | + | then $acc114781549 | |
63 | 63 | else { | |
64 | - | let $ | |
65 | - | if (($ | |
66 | - | then $ | |
64 | + | let $acc214781549 = containTokenId($acc114781549, $list14781549[1]) | |
65 | + | if (($size14781549 == 2)) | |
66 | + | then $acc214781549 | |
67 | 67 | else { | |
68 | - | let $ | |
69 | - | if (($ | |
70 | - | then $ | |
68 | + | let $acc314781549 = containTokenId($acc214781549, $list14781549[2]) | |
69 | + | if (($size14781549 == 3)) | |
70 | + | then $acc314781549 | |
71 | 71 | else { | |
72 | - | let $ | |
73 | - | if (($ | |
74 | - | then $ | |
72 | + | let $acc414781549 = containTokenId($acc314781549, $list14781549[3]) | |
73 | + | if (($size14781549 == 4)) | |
74 | + | then $acc414781549 | |
75 | 75 | else { | |
76 | - | let $ | |
77 | - | if (($ | |
78 | - | then $ | |
76 | + | let $acc514781549 = containTokenId($acc414781549, $list14781549[4]) | |
77 | + | if (($size14781549 == 5)) | |
78 | + | then $acc514781549 | |
79 | 79 | else { | |
80 | - | let $ | |
80 | + | let $acc614781549 = containTokenId($acc514781549, $list14781549[5]) | |
81 | 81 | throw("List size exceed 5") | |
82 | 82 | } | |
83 | 83 | } | |
96 | 96 | then (contain != true) | |
97 | 97 | else false) | |
98 | 98 | then throw((("This token ID " + getStrVar(contain)) + " is not allowed to operate in this account")) | |
99 | - | else verifier( | |
99 | + | else verifier(usersAddr) | |
100 | 100 | } | |
101 | 101 | ||
102 | 102 | func allowedAddrSponsoredFee (addr) = { | |
103 | 103 | let addrsList = split(getStringValue(addressFromPublicKey(usersPubKey), "allowedSponsorFee"), ",") | |
104 | 104 | let contain = { | |
105 | - | let $ | |
106 | - | let $ | |
107 | - | let $ | |
108 | - | if (($ | |
109 | - | then $ | |
105 | + | let $list19842031 = addrsList | |
106 | + | let $size19842031 = size($list19842031) | |
107 | + | let $acc019842031 = toString(addr) | |
108 | + | if (($size19842031 == 0)) | |
109 | + | then $acc019842031 | |
110 | 110 | else { | |
111 | - | let $ | |
112 | - | if (($ | |
113 | - | then $ | |
111 | + | let $acc119842031 = containAddr($acc019842031, $list19842031[0]) | |
112 | + | if (($size19842031 == 1)) | |
113 | + | then $acc119842031 | |
114 | 114 | else { | |
115 | - | let $ | |
116 | - | if (($ | |
117 | - | then $ | |
115 | + | let $acc219842031 = containAddr($acc119842031, $list19842031[1]) | |
116 | + | if (($size19842031 == 2)) | |
117 | + | then $acc219842031 | |
118 | 118 | else { | |
119 | - | let $ | |
120 | - | if (($ | |
121 | - | then $ | |
119 | + | let $acc319842031 = containAddr($acc219842031, $list19842031[2]) | |
120 | + | if (($size19842031 == 3)) | |
121 | + | then $acc319842031 | |
122 | 122 | else { | |
123 | - | let $ | |
124 | - | if (($ | |
125 | - | then $ | |
123 | + | let $acc419842031 = containAddr($acc319842031, $list19842031[3]) | |
124 | + | if (($size19842031 == 4)) | |
125 | + | then $acc419842031 | |
126 | 126 | else { | |
127 | - | let $ | |
128 | - | if (($ | |
129 | - | then $ | |
127 | + | let $acc519842031 = containAddr($acc419842031, $list19842031[4]) | |
128 | + | if (($size19842031 == 5)) | |
129 | + | then $acc519842031 | |
130 | 130 | else { | |
131 | - | let $ | |
131 | + | let $acc619842031 = containAddr($acc519842031, $list19842031[5]) | |
132 | 132 | throw("List size exceed 5") | |
133 | 133 | } | |
134 | 134 | } | |
158 | 158 | let price = allowedTransferTokens(o.assetPair.priceAsset) | |
159 | 159 | if (!(amount)) | |
160 | 160 | then throw("amount foi rejeitado") | |
161 | - | else if ( | |
161 | + | else if (price) | |
162 | 162 | then throw("price foi rejeitado") | |
163 | 163 | else throw("não sei o que aconteceu") | |
164 | 164 | case e: ExchangeTransaction => |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | 3 | let NONE = "none" | |
4 | 4 | let usersPubKey = base58'CH6NGp8BFPQ8gm6cPeVG9S3ZWp7m39eQnZU3eTdZgayU' | |
5 | 5 | let usersAddr = addressFromPublicKey(usersPubKey) | |
6 | 6 | let btns = base58'EGh2LufqeTEdihgaDz6iZosJtsyY98sqkHX2WP8Csnw4' | |
7 | 7 | let btnf = base58'7xAHFCPLRSa7XfNNbnd9DMPd9SkgpNfrptFvE4pJE7J' | |
8 | 8 | func verifier (account) = if ((account == this)) | |
9 | 9 | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
10 | 10 | else sigVerify(tx.bodyBytes, tx.proofs[0], usersPubKey) | |
11 | 11 | ||
12 | 12 | func getStrVar (key) = { | |
13 | 13 | let str = match key { | |
14 | 14 | case s: String => | |
15 | 15 | s | |
16 | 16 | case b: Boolean => | |
17 | 17 | toString(b) | |
18 | 18 | case i: Int => | |
19 | 19 | toString(i) | |
20 | 20 | case bv: ByteVector => | |
21 | 21 | toBase58String(bv) | |
22 | 22 | case ap: AssetPair => | |
23 | 23 | ((toBase58String(extract(ap.amountAsset)) + ",") + toBase58String(extract(ap.priceAsset))) | |
24 | 24 | case u: Unit => | |
25 | 25 | "empty" | |
26 | 26 | case _ => | |
27 | 27 | NONE | |
28 | 28 | } | |
29 | 29 | str | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | func containAddr (a,b) = { | |
33 | 33 | let addr = toString(addressFromPublicKey(fromBase58String(b))) | |
34 | 34 | if ((addr == a)) | |
35 | 35 | then true | |
36 | 36 | else if (if ((a == true)) | |
37 | 37 | then (addr != a) | |
38 | 38 | else false) | |
39 | 39 | then true | |
40 | 40 | else a | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | func containTokenId (a,b) = if ((b == a)) | |
44 | 44 | then true | |
45 | 45 | else if (if ((a == true)) | |
46 | 46 | then (b != a) | |
47 | 47 | else false) | |
48 | 48 | then true | |
49 | - | else | |
49 | + | else throw(("trava em" + b)) | |
50 | 50 | ||
51 | 51 | func allowedTransferTokens (assetId) = { | |
52 | 52 | let tokensIdList = split(getStringValue(addressFromPublicKey(usersPubKey), "allowedTransfers"), ",") | |
53 | 53 | let contain = { | |
54 | - | let $ | |
55 | - | let $ | |
56 | - | let $ | |
57 | - | if (($ | |
58 | - | then $ | |
54 | + | let $list14781549 = tokensIdList | |
55 | + | let $size14781549 = size($list14781549) | |
56 | + | let $acc014781549 = toBase58String(extract(assetId)) | |
57 | + | if (($size14781549 == 0)) | |
58 | + | then $acc014781549 | |
59 | 59 | else { | |
60 | - | let $ | |
61 | - | if (($ | |
62 | - | then $ | |
60 | + | let $acc114781549 = containTokenId($acc014781549, $list14781549[0]) | |
61 | + | if (($size14781549 == 1)) | |
62 | + | then $acc114781549 | |
63 | 63 | else { | |
64 | - | let $ | |
65 | - | if (($ | |
66 | - | then $ | |
64 | + | let $acc214781549 = containTokenId($acc114781549, $list14781549[1]) | |
65 | + | if (($size14781549 == 2)) | |
66 | + | then $acc214781549 | |
67 | 67 | else { | |
68 | - | let $ | |
69 | - | if (($ | |
70 | - | then $ | |
68 | + | let $acc314781549 = containTokenId($acc214781549, $list14781549[2]) | |
69 | + | if (($size14781549 == 3)) | |
70 | + | then $acc314781549 | |
71 | 71 | else { | |
72 | - | let $ | |
73 | - | if (($ | |
74 | - | then $ | |
72 | + | let $acc414781549 = containTokenId($acc314781549, $list14781549[3]) | |
73 | + | if (($size14781549 == 4)) | |
74 | + | then $acc414781549 | |
75 | 75 | else { | |
76 | - | let $ | |
77 | - | if (($ | |
78 | - | then $ | |
76 | + | let $acc514781549 = containTokenId($acc414781549, $list14781549[4]) | |
77 | + | if (($size14781549 == 5)) | |
78 | + | then $acc514781549 | |
79 | 79 | else { | |
80 | - | let $ | |
80 | + | let $acc614781549 = containTokenId($acc514781549, $list14781549[5]) | |
81 | 81 | throw("List size exceed 5") | |
82 | 82 | } | |
83 | 83 | } | |
84 | 84 | } | |
85 | 85 | } | |
86 | 86 | } | |
87 | 87 | } | |
88 | 88 | } | |
89 | 89 | if (!(isDefined(assetId))) | |
90 | 90 | then true | |
91 | 91 | else if (if (isDefined(assetId)) | |
92 | 92 | then (contain == true) | |
93 | 93 | else false) | |
94 | 94 | then true | |
95 | 95 | else if (if (isDefined(assetId)) | |
96 | 96 | then (contain != true) | |
97 | 97 | else false) | |
98 | 98 | then throw((("This token ID " + getStrVar(contain)) + " is not allowed to operate in this account")) | |
99 | - | else verifier( | |
99 | + | else verifier(usersAddr) | |
100 | 100 | } | |
101 | 101 | ||
102 | 102 | func allowedAddrSponsoredFee (addr) = { | |
103 | 103 | let addrsList = split(getStringValue(addressFromPublicKey(usersPubKey), "allowedSponsorFee"), ",") | |
104 | 104 | let contain = { | |
105 | - | let $ | |
106 | - | let $ | |
107 | - | let $ | |
108 | - | if (($ | |
109 | - | then $ | |
105 | + | let $list19842031 = addrsList | |
106 | + | let $size19842031 = size($list19842031) | |
107 | + | let $acc019842031 = toString(addr) | |
108 | + | if (($size19842031 == 0)) | |
109 | + | then $acc019842031 | |
110 | 110 | else { | |
111 | - | let $ | |
112 | - | if (($ | |
113 | - | then $ | |
111 | + | let $acc119842031 = containAddr($acc019842031, $list19842031[0]) | |
112 | + | if (($size19842031 == 1)) | |
113 | + | then $acc119842031 | |
114 | 114 | else { | |
115 | - | let $ | |
116 | - | if (($ | |
117 | - | then $ | |
115 | + | let $acc219842031 = containAddr($acc119842031, $list19842031[1]) | |
116 | + | if (($size19842031 == 2)) | |
117 | + | then $acc219842031 | |
118 | 118 | else { | |
119 | - | let $ | |
120 | - | if (($ | |
121 | - | then $ | |
119 | + | let $acc319842031 = containAddr($acc219842031, $list19842031[2]) | |
120 | + | if (($size19842031 == 3)) | |
121 | + | then $acc319842031 | |
122 | 122 | else { | |
123 | - | let $ | |
124 | - | if (($ | |
125 | - | then $ | |
123 | + | let $acc419842031 = containAddr($acc319842031, $list19842031[3]) | |
124 | + | if (($size19842031 == 4)) | |
125 | + | then $acc419842031 | |
126 | 126 | else { | |
127 | - | let $ | |
128 | - | if (($ | |
129 | - | then $ | |
127 | + | let $acc519842031 = containAddr($acc419842031, $list19842031[4]) | |
128 | + | if (($size19842031 == 5)) | |
129 | + | then $acc519842031 | |
130 | 130 | else { | |
131 | - | let $ | |
131 | + | let $acc619842031 = containAddr($acc519842031, $list19842031[5]) | |
132 | 132 | throw("List size exceed 5") | |
133 | 133 | } | |
134 | 134 | } | |
135 | 135 | } | |
136 | 136 | } | |
137 | 137 | } | |
138 | 138 | } | |
139 | 139 | } | |
140 | 140 | if ((contain != true)) | |
141 | 141 | then throw((("This address " + getStrVar(contain)) + " is not allowed to operate with the BitNodes sponsored token")) | |
142 | 142 | else verifier(this) | |
143 | 143 | } | |
144 | 144 | ||
145 | 145 | match tx { | |
146 | 146 | case t: TransferTransaction => | |
147 | 147 | if (if ((t.assetId != btnf)) | |
148 | 148 | then (t.feeAssetId != btnf) | |
149 | 149 | else false) | |
150 | 150 | then allowedTransferTokens(t.assetId) | |
151 | 151 | else if (if ((t.assetId == btnf)) | |
152 | 152 | then true | |
153 | 153 | else (t.feeAssetId == btnf)) | |
154 | 154 | then allowedAddrSponsoredFee(addressFromRecipient(t.recipient)) | |
155 | 155 | else throw("Operação não autorizada para contas centralizadas na Plataforma BitNodes") | |
156 | 156 | case o: Order => | |
157 | 157 | let amount = allowedTransferTokens(o.assetPair.amountAsset) | |
158 | 158 | let price = allowedTransferTokens(o.assetPair.priceAsset) | |
159 | 159 | if (!(amount)) | |
160 | 160 | then throw("amount foi rejeitado") | |
161 | - | else if ( | |
161 | + | else if (price) | |
162 | 162 | then throw("price foi rejeitado") | |
163 | 163 | else throw("não sei o que aconteceu") | |
164 | 164 | case e: ExchangeTransaction => | |
165 | 165 | true | |
166 | 166 | case burn: BurnTransaction => | |
167 | 167 | verifier(usersAddr) | |
168 | 168 | case d: DataTransaction => | |
169 | 169 | verifier(usersAddr) | |
170 | 170 | case s: SetScriptTransaction => | |
171 | 171 | verifier(usersAddr) | |
172 | 172 | case l: LeaseTransaction => | |
173 | 173 | allowedAddrSponsoredFee(addressFromRecipient(l.recipient)) | |
174 | 174 | case c: LeaseCancelTransaction => | |
175 | 175 | verifier(this) | |
176 | 176 | case _ => | |
177 | 177 | false | |
178 | 178 | } |
github/deemru/w8io/169f3d6 55.08 ms ◑