tx · GoCvFPTQytEgpYAoE3Jcv7konR3j3SMbvg9ACQcZmbke 3Mx66EFd8iB1tZ6vu7Xx5GMkzbKQc3Nrw81: -0.01400000 Waves 2020.08.12 05:24 [1128710] smart account 3Mx66EFd8iB1tZ6vu7Xx5GMkzbKQc3Nrw81 > SELF 0.00000000 Waves
{ "type": 13, "id": "GoCvFPTQytEgpYAoE3Jcv7konR3j3SMbvg9ACQcZmbke", "fee": 1400000, "feeAssetId": null, "timestamp": 1597199086206, "version": 1, "sender": "3Mx66EFd8iB1tZ6vu7Xx5GMkzbKQc3Nrw81", "senderPublicKey": "7F9WJ2MEaCQTxjwqCQmL9jHicqJVc3uCmntzCMAK8yq6", "proofs": [ "418Ty7L5RcrrhVsiWDQ7npTRwKo1qGK4Hs7T2nQwSzgRg1pn1hH29iFWTQQpxPkQqHXe7cWogHNBmFscDHqGHBhY" ], "script": "base64:AwQAAAAETk9ORQIAAAAEbm9uZQQAAAALdXNlcnNQdWJLZXkBAAAAIKeP6tgl4CP2PWCZbTcLVLGPExrT9u/W4PAFsxrOIcYHBAAAAAl1c2Vyc0FkZHIJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEFAAAAC3VzZXJzUHViS2V5BAAAAARidG5zAQAAACDFLOWBobFDqtyu6bkFDRsq16C369fJHs5Bnyp0LEWdcwQAAAAEYnRuZgEAAAAgAcfavlePt+AR+muoBefYqFrjn0Oc5fUH1esIaonljXkKAQAAAAh2ZXJpZmllcgAAAAEAAAAHYWNjb3VudAMJAAAAAAAAAgUAAAAHYWNjb3VudAUAAAAEdGhpcwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAA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W5nZVRyYW5zYWN0aW9uBAAAAAFlBQAAAAckbWF0Y2gwBwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPQnVyblRyYW5zYWN0aW9uBAAAAARidXJuBQAAAAckbWF0Y2gwCQEAAAAIdmVyaWZpZXIAAAABBQAAAAl1c2Vyc0FkZHIDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAkBAAAACHZlcmlmaWVyAAAAAQUAAAAJdXNlcnNBZGRyAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAABcwUAAAAHJG1hdGNoMAkBAAAACHZlcmlmaWVyAAAAAQUAAAAJdXNlcnNBZGRyAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABBMZWFzZVRyYW5zYWN0aW9uBAAAAAFsBQAAAAckbWF0Y2gwCQEAAAAUYWxsb3dlZEFkZHJTcG9uc29yZWQAAAABCQAEJAAAAAEIBQAAAAFsAAAACXJlY2lwaWVudAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAWTGVhc2VDYW5jZWxUcmFuc2FjdGlvbgQAAAABYwUAAAAHJG1hdGNoMAkBAAAACHZlcmlmaWVyAAAAAQUAAAAEdGhpcwdCHcay", "chainId": 84, "height": 1128710, "spentComplexity": 0 } View: original | compacted Prev: 57bkVKYQgxc6KcccwU4GDNMB8DsUh2ysuu5P9tyWRmmr Next: none Diff:
Old | New | Differences | |
---|---|---|---|
38 | 38 | then true | |
39 | 39 | else a | |
40 | 40 | ||
41 | - | func | |
42 | - | let tokensIdList = split(getStringValue(addressFromPublicKey(usersPubKey), " | |
41 | + | func allowedTransactionTokens (assetId) = { | |
42 | + | let tokensIdList = split(getStringValue(addressFromPublicKey(usersPubKey), "allowedTokenTransaction"), ",") | |
43 | 43 | let contain = { | |
44 | - | let $ | |
45 | - | let $ | |
46 | - | let $ | |
47 | - | if (($ | |
48 | - | then $ | |
44 | + | let $list14741545 = tokensIdList | |
45 | + | let $size14741545 = size($list14741545) | |
46 | + | let $acc014741545 = toBase58String(extract(assetId)) | |
47 | + | if (($size14741545 == 0)) | |
48 | + | then $acc014741545 | |
49 | 49 | else { | |
50 | - | let $ | |
51 | - | if (($ | |
52 | - | then $ | |
50 | + | let $acc114741545 = containTokenId($acc014741545, $list14741545[0]) | |
51 | + | if (($size14741545 == 1)) | |
52 | + | then $acc114741545 | |
53 | 53 | else { | |
54 | - | let $ | |
55 | - | if (($ | |
56 | - | then $ | |
54 | + | let $acc214741545 = containTokenId($acc114741545, $list14741545[1]) | |
55 | + | if (($size14741545 == 2)) | |
56 | + | then $acc214741545 | |
57 | 57 | else { | |
58 | - | let $ | |
59 | - | if (($ | |
60 | - | then $ | |
58 | + | let $acc314741545 = containTokenId($acc214741545, $list14741545[2]) | |
59 | + | if (($size14741545 == 3)) | |
60 | + | then $acc314741545 | |
61 | 61 | else { | |
62 | - | let $ | |
63 | - | if (($ | |
64 | - | then $ | |
62 | + | let $acc414741545 = containTokenId($acc314741545, $list14741545[3]) | |
63 | + | if (($size14741545 == 4)) | |
64 | + | then $acc414741545 | |
65 | 65 | else { | |
66 | - | let $ | |
67 | - | if (($ | |
68 | - | then $ | |
66 | + | let $acc514741545 = containTokenId($acc414741545, $list14741545[4]) | |
67 | + | if (($size14741545 == 5)) | |
68 | + | then $acc514741545 | |
69 | 69 | else { | |
70 | - | let $ | |
70 | + | let $acc614741545 = containTokenId($acc514741545, $list14741545[5]) | |
71 | 71 | throw("List size exceed 5") | |
72 | 72 | } | |
73 | 73 | } | |
89 | 89 | else verifier(usersAddr) | |
90 | 90 | } | |
91 | 91 | ||
92 | - | func | |
93 | - | let addrsList = split(getStringValue(addressFromPublicKey(usersPubKey), " | |
92 | + | func allowedAddrSponsored (addr) = { | |
93 | + | let addrsList = split(getStringValue(addressFromPublicKey(usersPubKey), "allowedSponsorsAddr"), ",") | |
94 | 94 | let contain = { | |
95 | - | let $ | |
96 | - | let $ | |
97 | - | let $ | |
98 | - | if (($ | |
99 | - | then $ | |
95 | + | let $list19792026 = addrsList | |
96 | + | let $size19792026 = size($list19792026) | |
97 | + | let $acc019792026 = toString(addr) | |
98 | + | if (($size19792026 == 0)) | |
99 | + | then $acc019792026 | |
100 | 100 | else { | |
101 | - | let $ | |
102 | - | if (($ | |
103 | - | then $ | |
101 | + | let $acc119792026 = containAddr($acc019792026, $list19792026[0]) | |
102 | + | if (($size19792026 == 1)) | |
103 | + | then $acc119792026 | |
104 | 104 | else { | |
105 | - | let $ | |
106 | - | if (($ | |
107 | - | then $ | |
105 | + | let $acc219792026 = containAddr($acc119792026, $list19792026[1]) | |
106 | + | if (($size19792026 == 2)) | |
107 | + | then $acc219792026 | |
108 | 108 | else { | |
109 | - | let $ | |
110 | - | if (($ | |
111 | - | then $ | |
109 | + | let $acc319792026 = containAddr($acc219792026, $list19792026[2]) | |
110 | + | if (($size19792026 == 3)) | |
111 | + | then $acc319792026 | |
112 | 112 | else { | |
113 | - | let $ | |
114 | - | if (($ | |
115 | - | then $ | |
113 | + | let $acc419792026 = containAddr($acc319792026, $list19792026[3]) | |
114 | + | if (($size19792026 == 4)) | |
115 | + | then $acc419792026 | |
116 | 116 | else { | |
117 | - | let $ | |
118 | - | if (($ | |
119 | - | then $ | |
117 | + | let $acc519792026 = containAddr($acc419792026, $list19792026[4]) | |
118 | + | if (($size19792026 == 5)) | |
119 | + | then $acc519792026 | |
120 | 120 | else { | |
121 | - | let $ | |
121 | + | let $acc619792026 = containAddr($acc519792026, $list19792026[5]) | |
122 | 122 | throw("List size exceed 5") | |
123 | 123 | } | |
124 | 124 | } | |
137 | 137 | if (if ((t.assetId != btnf)) | |
138 | 138 | then (t.feeAssetId != btnf) | |
139 | 139 | else false) | |
140 | - | then | |
140 | + | then allowedTransactionTokens(t.assetId) | |
141 | 141 | else if (if ((t.assetId == btnf)) | |
142 | 142 | then true | |
143 | 143 | else (t.feeAssetId == btnf)) | |
144 | - | then | |
144 | + | then allowedAddrSponsored(addressFromRecipient(t.recipient)) | |
145 | 145 | else throw("Operação não autorizada para contas centralizadas na Plataforma BitNodes") | |
146 | + | case ist: InvokeScriptTransaction => | |
147 | + | allowedAddrSponsored(addressFromRecipient(ist.dApp)) | |
146 | 148 | case o: Order => | |
147 | 149 | false | |
148 | 150 | case e: ExchangeTransaction => | |
154 | 156 | case s: SetScriptTransaction => | |
155 | 157 | verifier(usersAddr) | |
156 | 158 | case l: LeaseTransaction => | |
157 | - | | |
159 | + | allowedAddrSponsored(addressFromRecipient(l.recipient)) | |
158 | 160 | case c: LeaseCancelTransaction => | |
159 | 161 | verifier(this) | |
160 | 162 | case _ => |
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 _ => | |
17 | 17 | NONE | |
18 | 18 | } | |
19 | 19 | str | |
20 | 20 | } | |
21 | 21 | ||
22 | 22 | func containAddr (a,b) = { | |
23 | 23 | let addr = toString(addressFromPublicKey(fromBase58String(b))) | |
24 | 24 | if ((addr == a)) | |
25 | 25 | then true | |
26 | 26 | else if (if ((a == true)) | |
27 | 27 | then (addr != a) | |
28 | 28 | else false) | |
29 | 29 | then true | |
30 | 30 | else a | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | func containTokenId (a,b) = if ((b == a)) | |
34 | 34 | then true | |
35 | 35 | else if (if ((a == true)) | |
36 | 36 | then (b != a) | |
37 | 37 | else false) | |
38 | 38 | then true | |
39 | 39 | else a | |
40 | 40 | ||
41 | - | func | |
42 | - | let tokensIdList = split(getStringValue(addressFromPublicKey(usersPubKey), " | |
41 | + | func allowedTransactionTokens (assetId) = { | |
42 | + | let tokensIdList = split(getStringValue(addressFromPublicKey(usersPubKey), "allowedTokenTransaction"), ",") | |
43 | 43 | let contain = { | |
44 | - | let $ | |
45 | - | let $ | |
46 | - | let $ | |
47 | - | if (($ | |
48 | - | then $ | |
44 | + | let $list14741545 = tokensIdList | |
45 | + | let $size14741545 = size($list14741545) | |
46 | + | let $acc014741545 = toBase58String(extract(assetId)) | |
47 | + | if (($size14741545 == 0)) | |
48 | + | then $acc014741545 | |
49 | 49 | else { | |
50 | - | let $ | |
51 | - | if (($ | |
52 | - | then $ | |
50 | + | let $acc114741545 = containTokenId($acc014741545, $list14741545[0]) | |
51 | + | if (($size14741545 == 1)) | |
52 | + | then $acc114741545 | |
53 | 53 | else { | |
54 | - | let $ | |
55 | - | if (($ | |
56 | - | then $ | |
54 | + | let $acc214741545 = containTokenId($acc114741545, $list14741545[1]) | |
55 | + | if (($size14741545 == 2)) | |
56 | + | then $acc214741545 | |
57 | 57 | else { | |
58 | - | let $ | |
59 | - | if (($ | |
60 | - | then $ | |
58 | + | let $acc314741545 = containTokenId($acc214741545, $list14741545[2]) | |
59 | + | if (($size14741545 == 3)) | |
60 | + | then $acc314741545 | |
61 | 61 | else { | |
62 | - | let $ | |
63 | - | if (($ | |
64 | - | then $ | |
62 | + | let $acc414741545 = containTokenId($acc314741545, $list14741545[3]) | |
63 | + | if (($size14741545 == 4)) | |
64 | + | then $acc414741545 | |
65 | 65 | else { | |
66 | - | let $ | |
67 | - | if (($ | |
68 | - | then $ | |
66 | + | let $acc514741545 = containTokenId($acc414741545, $list14741545[4]) | |
67 | + | if (($size14741545 == 5)) | |
68 | + | then $acc514741545 | |
69 | 69 | else { | |
70 | - | let $ | |
70 | + | let $acc614741545 = containTokenId($acc514741545, $list14741545[5]) | |
71 | 71 | throw("List size exceed 5") | |
72 | 72 | } | |
73 | 73 | } | |
74 | 74 | } | |
75 | 75 | } | |
76 | 76 | } | |
77 | 77 | } | |
78 | 78 | } | |
79 | 79 | if (!(isDefined(assetId))) | |
80 | 80 | then true | |
81 | 81 | else if (if (isDefined(assetId)) | |
82 | 82 | then (contain == true) | |
83 | 83 | else false) | |
84 | 84 | then true | |
85 | 85 | else if (if (isDefined(assetId)) | |
86 | 86 | then (contain != true) | |
87 | 87 | else false) | |
88 | 88 | then throw((("This token ID " + getStrVar(contain)) + " is not allowed to operate in this account")) | |
89 | 89 | else verifier(usersAddr) | |
90 | 90 | } | |
91 | 91 | ||
92 | - | func | |
93 | - | let addrsList = split(getStringValue(addressFromPublicKey(usersPubKey), " | |
92 | + | func allowedAddrSponsored (addr) = { | |
93 | + | let addrsList = split(getStringValue(addressFromPublicKey(usersPubKey), "allowedSponsorsAddr"), ",") | |
94 | 94 | let contain = { | |
95 | - | let $ | |
96 | - | let $ | |
97 | - | let $ | |
98 | - | if (($ | |
99 | - | then $ | |
95 | + | let $list19792026 = addrsList | |
96 | + | let $size19792026 = size($list19792026) | |
97 | + | let $acc019792026 = toString(addr) | |
98 | + | if (($size19792026 == 0)) | |
99 | + | then $acc019792026 | |
100 | 100 | else { | |
101 | - | let $ | |
102 | - | if (($ | |
103 | - | then $ | |
101 | + | let $acc119792026 = containAddr($acc019792026, $list19792026[0]) | |
102 | + | if (($size19792026 == 1)) | |
103 | + | then $acc119792026 | |
104 | 104 | else { | |
105 | - | let $ | |
106 | - | if (($ | |
107 | - | then $ | |
105 | + | let $acc219792026 = containAddr($acc119792026, $list19792026[1]) | |
106 | + | if (($size19792026 == 2)) | |
107 | + | then $acc219792026 | |
108 | 108 | else { | |
109 | - | let $ | |
110 | - | if (($ | |
111 | - | then $ | |
109 | + | let $acc319792026 = containAddr($acc219792026, $list19792026[2]) | |
110 | + | if (($size19792026 == 3)) | |
111 | + | then $acc319792026 | |
112 | 112 | else { | |
113 | - | let $ | |
114 | - | if (($ | |
115 | - | then $ | |
113 | + | let $acc419792026 = containAddr($acc319792026, $list19792026[3]) | |
114 | + | if (($size19792026 == 4)) | |
115 | + | then $acc419792026 | |
116 | 116 | else { | |
117 | - | let $ | |
118 | - | if (($ | |
119 | - | then $ | |
117 | + | let $acc519792026 = containAddr($acc419792026, $list19792026[4]) | |
118 | + | if (($size19792026 == 5)) | |
119 | + | then $acc519792026 | |
120 | 120 | else { | |
121 | - | let $ | |
121 | + | let $acc619792026 = containAddr($acc519792026, $list19792026[5]) | |
122 | 122 | throw("List size exceed 5") | |
123 | 123 | } | |
124 | 124 | } | |
125 | 125 | } | |
126 | 126 | } | |
127 | 127 | } | |
128 | 128 | } | |
129 | 129 | } | |
130 | 130 | if ((contain != true)) | |
131 | 131 | then throw((("This address " + getStrVar(contain)) + " is not allowed to operate with the BitNodes sponsored token")) | |
132 | 132 | else verifier(this) | |
133 | 133 | } | |
134 | 134 | ||
135 | 135 | match tx { | |
136 | 136 | case t: TransferTransaction => | |
137 | 137 | if (if ((t.assetId != btnf)) | |
138 | 138 | then (t.feeAssetId != btnf) | |
139 | 139 | else false) | |
140 | - | then | |
140 | + | then allowedTransactionTokens(t.assetId) | |
141 | 141 | else if (if ((t.assetId == btnf)) | |
142 | 142 | then true | |
143 | 143 | else (t.feeAssetId == btnf)) | |
144 | - | then | |
144 | + | then allowedAddrSponsored(addressFromRecipient(t.recipient)) | |
145 | 145 | else throw("Operação não autorizada para contas centralizadas na Plataforma BitNodes") | |
146 | + | case ist: InvokeScriptTransaction => | |
147 | + | allowedAddrSponsored(addressFromRecipient(ist.dApp)) | |
146 | 148 | case o: Order => | |
147 | 149 | false | |
148 | 150 | case e: ExchangeTransaction => | |
149 | 151 | false | |
150 | 152 | case burn: BurnTransaction => | |
151 | 153 | verifier(usersAddr) | |
152 | 154 | case d: DataTransaction => | |
153 | 155 | verifier(usersAddr) | |
154 | 156 | case s: SetScriptTransaction => | |
155 | 157 | verifier(usersAddr) | |
156 | 158 | case l: LeaseTransaction => | |
157 | - | | |
159 | + | allowedAddrSponsored(addressFromRecipient(l.recipient)) | |
158 | 160 | case c: LeaseCancelTransaction => | |
159 | 161 | verifier(this) | |
160 | 162 | case _ => | |
161 | 163 | false | |
162 | 164 | } |
github/deemru/w8io/169f3d6 85.74 ms ◑