tx · AVBDScsJMvWMBwFaw9fUBN8kFrQZnvpcb9rNEfghEA1B 3N4EFimhkN5F5mh7kUkL9tuTFRxMa4kmvpN: -0.01400000 Waves 2020.10.07 17:26 [1210269] smart account 3N4EFimhkN5F5mh7kUkL9tuTFRxMa4kmvpN > SELF 0.00000000 Waves
{ "type": 13, "id": "AVBDScsJMvWMBwFaw9fUBN8kFrQZnvpcb9rNEfghEA1B", "fee": 1400000, "feeAssetId": null, "timestamp": 1602080745743, "version": 1, "sender": "3N4EFimhkN5F5mh7kUkL9tuTFRxMa4kmvpN", "senderPublicKey": "GFK7PYB6cXjs4wEDvwEwkzcx1NxSS7QwXSxy7JmaBcXk", "proofs": [], "script": "base64:AwQAAAALYWRkcmVzc0Jvb2sJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVRWgdR5NBM7vuJoxo7QLI34uXJ2wFdvAd4EAAAAE3doaXRlbGlzdEFkZHJlc3NLZXkCAAAAEHdoaXRlbGlzdEFkZHJlc3MEAAAAF2RBcHBXaGl0ZWxpc3RBZGRyZXNzS2V5AgAAABRkQXBwV2hpdGVsaXN0QWRkcmVzcwQAAAARbWF0Y2hlckFkZHJlc3NLZXkCAAAADm1hdGNoZXJBZGRyZXNzBAAAABFnYXRld2F5QWRkcmVzc0tleQIAAAAOZ2F0ZXdheUFkZHJlc3MEAAAAFmdhdGV3YXlDb250cm9sQXNzZXRLZXkCAAAAE2dhdGV3YXlDb250cm9sQXNzZXQEAAAACnZhbGlkU3RhdGUAAAAAAAAAA+gEAAAAA3ZlcgIAAAAFNS4wLjUEAAAACnByb3RlY3RvcjABAAAAIOs0AsfYmDaU6YPwW72zJ3uwcQlYqm5qxCuhonIChTUnBAAAAApwcm90ZWN0b3IxAQAAACD/z8eBD8+wEio+asqwp+Q3C8kIkStDm8P5OWSM1UxFJQQAAAAKcHJvdGVjdG9yMgEAAAAgX+1zoOIXlB5TV2BM0ijDaqvNjxdFFjxJ41TJfJExdEMEAAAACnByb3RlY3RvcjMBAA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RqN44TvbhwepwqhHjE134 Next: 44HpmrpB3GLiR4e7TPwDexfMUbps4r2JVNNajLRH5fmW Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | let gatewayAddressKey = "gatewayAddress" | |
8 | 8 | let gatewayControlAssetKey = "gatewayControlAsset" | |
9 | 9 | let validState = 1000 | |
10 | - | let ver = "5.0. | |
10 | + | let ver = "5.0.5" | |
11 | 11 | let protector0 = base58'Gq8oqv19zNXKzz4QoYE8o6wgobbtmfiLBm1DD8zmfawx' | |
12 | 12 | let protector1 = base58'JDaizZSMrRZnaZVFQzdixsxoZUnBirfyap3F4zfVmHWt' | |
13 | 13 | let protector2 = base58'7TTjchn9fUMdgBn5TMqer3YGdUr61djeokuqGAtxAjke' | |
98 | 98 | let pAddress1 = getAddressFromBook("pAddress1") | |
99 | 99 | let pAddress2 = getAddressFromBook("pAddress2") | |
100 | 100 | let pAddress3 = getAddressFromBook("pAddress3") | |
101 | - | let pAddress4 = getAddressFromBook("pAddress4") | |
102 | - | let pAddress5 = getAddressFromBook("pAddress5") | |
103 | - | let pAddress6 = getAddressFromBook("pAddress6") | |
104 | - | let pAddress7 = getAddressFromBook("pAddress7") | |
105 | - | let pAddress8 = getAddressFromBook("pAddress8") | |
106 | 101 | let pKey1Signed = if (if (isDefined(getInteger(pAddress1, txId))) | |
107 | 102 | then true | |
108 | 103 | else sigVerify(tx.bodyBytes, tx.proofs[0], protector0)) | |
110 | 105 | else 0 | |
111 | 106 | let pKey2Signed = if (if (isDefined(getInteger(pAddress2, txId))) | |
112 | 107 | then true | |
113 | - | else sigVerify(tx.bodyBytes, tx.proofs[ | |
108 | + | else sigVerify(tx.bodyBytes, tx.proofs[1], protector1)) | |
114 | 109 | then 1 | |
115 | 110 | else 0 | |
116 | 111 | let pKey3Signed = if (if (isDefined(getInteger(pAddress3, txId))) | |
117 | 112 | then true | |
118 | - | else sigVerify(tx.bodyBytes, tx.proofs[ | |
113 | + | else sigVerify(tx.bodyBytes, tx.proofs[2], protector2)) | |
119 | 114 | then 1 | |
120 | 115 | else 0 | |
121 | 116 | (((pKey1Signed + pKey2Signed) + pKey3Signed) >= 3) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | 3 | let addressBook = Address(base58'3MwoVRAPfC2NKuuYJKHVAVtUFhq8MyTEfQh') | |
4 | 4 | let whitelistAddressKey = "whitelistAddress" | |
5 | 5 | let dAppWhitelistAddressKey = "dAppWhitelistAddress" | |
6 | 6 | let matcherAddressKey = "matcherAddress" | |
7 | 7 | let gatewayAddressKey = "gatewayAddress" | |
8 | 8 | let gatewayControlAssetKey = "gatewayControlAsset" | |
9 | 9 | let validState = 1000 | |
10 | - | let ver = "5.0. | |
10 | + | let ver = "5.0.5" | |
11 | 11 | let protector0 = base58'Gq8oqv19zNXKzz4QoYE8o6wgobbtmfiLBm1DD8zmfawx' | |
12 | 12 | let protector1 = base58'JDaizZSMrRZnaZVFQzdixsxoZUnBirfyap3F4zfVmHWt' | |
13 | 13 | let protector2 = base58'7TTjchn9fUMdgBn5TMqer3YGdUr61djeokuqGAtxAjke' | |
14 | 14 | let protector3 = base58'HUKkWXsC7xzSncw7EDb5NPsXKFx5VJq82hUMgB1G7ELK' | |
15 | 15 | let protector4 = base58'E9rAmSbNdH2F3dYffqTSbvRA96pX1HBYWbAHQrNJu2Ej' | |
16 | 16 | func getAddressFromBook (key) = match getString(addressBook, key) { | |
17 | 17 | case a: String => | |
18 | 18 | Address(fromBase58String(a)) | |
19 | 19 | case _ => | |
20 | 20 | throw("#008 no key") | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | func getAssetFromAddressBook () = match getString(extract(addressBook), gatewayControlAssetKey) { | |
24 | 24 | case a: String => | |
25 | 25 | toBytes(a) | |
26 | 26 | case _ => | |
27 | 27 | throw("#009 no key") | |
28 | 28 | } | |
29 | 29 | ||
30 | 30 | match tx { | |
31 | 31 | case o: Order => | |
32 | 32 | if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
33 | 33 | then (addressFromPublicKey(o.matcherPublicKey) == getAddressFromBook(matcherAddressKey)) | |
34 | 34 | else false | |
35 | 35 | case tx: TransferTransaction => | |
36 | 36 | if (!(sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))) | |
37 | 37 | then throw("#001 Transaction must be signed by owner") | |
38 | 38 | else { | |
39 | 39 | let userState = getInteger(getAddressFromBook(whitelistAddressKey), toBase58String(tx.sender.bytes)) | |
40 | 40 | if (!(isDefined(userState))) | |
41 | 41 | then throw("#002 Address not in whitelist") | |
42 | 42 | else if ((userState != validState)) | |
43 | 43 | then throw("#003 User not in valid state") | |
44 | 44 | else if (!(isDefined(tx.assetId))) | |
45 | 45 | then { | |
46 | 46 | let key = (toBase58String(tx.sender.bytes) + "_WAVES") | |
47 | 47 | let minAmount = getInteger(getAddressFromBook(whitelistAddressKey), key) | |
48 | 48 | if (isDefined(minAmount)) | |
49 | 49 | then { | |
50 | 50 | let curBalance = wavesBalance(extract(tx.sender)) | |
51 | 51 | if ((extract(minAmount) > (curBalance - tx.amount))) | |
52 | 52 | then throw("#004 Unable to send such amount (type=2)") | |
53 | 53 | else true | |
54 | 54 | } | |
55 | 55 | else { | |
56 | 56 | let keyOverall = "res_WAVES" | |
57 | 57 | let minAmountOverall = getInteger(getAddressFromBook(whitelistAddressKey), keyOverall) | |
58 | 58 | if (isDefined(minAmountOverall)) | |
59 | 59 | then { | |
60 | 60 | let curBalance = wavesBalance(extract(tx.sender)) | |
61 | 61 | if ((extract(minAmountOverall) > (curBalance - tx.amount))) | |
62 | 62 | then throw("#005 Unable to send such amount (type=1)") | |
63 | 63 | else true | |
64 | 64 | } | |
65 | 65 | else true | |
66 | 66 | } | |
67 | 67 | } | |
68 | 68 | else if ((tx.assetId == getAssetFromAddressBook())) | |
69 | 69 | then (tx.recipient == getAddressFromBook(gatewayAddressKey)) | |
70 | 70 | else { | |
71 | 71 | let white1List = toBase58String(tx.sender.bytes) | |
72 | 72 | let assetTxt = toBase58String(extract(tx.assetId)) | |
73 | 73 | let white1ListAsset = ((white1List + "_") + assetTxt) | |
74 | 74 | let white1ListOverall = ("res_" + assetTxt) | |
75 | 75 | let white1ListAssetEntry = getInteger(getAddressFromBook(whitelistAddressKey), white1ListAsset) | |
76 | 76 | if (!(isDefined(white1ListAssetEntry))) | |
77 | 77 | then { | |
78 | 78 | let white1ListOverallEntry = getInteger(getAddressFromBook(whitelistAddressKey), white1ListOverall) | |
79 | 79 | if (!(isDefined(white1ListOverallEntry))) | |
80 | 80 | then true | |
81 | 81 | else { | |
82 | 82 | let cur1Balance = assetBalance(tx.sender, tx.assetId) | |
83 | 83 | if ((extract(white1ListOverallEntry) > (cur1Balance - tx.amount))) | |
84 | 84 | then throw("#006 Unable to send such amount (type=1)") | |
85 | 85 | else true | |
86 | 86 | } | |
87 | 87 | } | |
88 | 88 | else { | |
89 | 89 | let cur1Balance = assetBalance(tx.sender, tx.assetId) | |
90 | 90 | if ((extract(white1ListAssetEntry) > (cur1Balance - tx.amount))) | |
91 | 91 | then throw("#007 Unable to send such amount (type=2)") | |
92 | 92 | else true | |
93 | 93 | } | |
94 | 94 | } | |
95 | 95 | } | |
96 | 96 | case tx: SetScriptTransaction => | |
97 | 97 | let txId = toBase58String(tx.id) | |
98 | 98 | let pAddress1 = getAddressFromBook("pAddress1") | |
99 | 99 | let pAddress2 = getAddressFromBook("pAddress2") | |
100 | 100 | let pAddress3 = getAddressFromBook("pAddress3") | |
101 | - | let pAddress4 = getAddressFromBook("pAddress4") | |
102 | - | let pAddress5 = getAddressFromBook("pAddress5") | |
103 | - | let pAddress6 = getAddressFromBook("pAddress6") | |
104 | - | let pAddress7 = getAddressFromBook("pAddress7") | |
105 | - | let pAddress8 = getAddressFromBook("pAddress8") | |
106 | 101 | let pKey1Signed = if (if (isDefined(getInteger(pAddress1, txId))) | |
107 | 102 | then true | |
108 | 103 | else sigVerify(tx.bodyBytes, tx.proofs[0], protector0)) | |
109 | 104 | then 1 | |
110 | 105 | else 0 | |
111 | 106 | let pKey2Signed = if (if (isDefined(getInteger(pAddress2, txId))) | |
112 | 107 | then true | |
113 | - | else sigVerify(tx.bodyBytes, tx.proofs[ | |
108 | + | else sigVerify(tx.bodyBytes, tx.proofs[1], protector1)) | |
114 | 109 | then 1 | |
115 | 110 | else 0 | |
116 | 111 | let pKey3Signed = if (if (isDefined(getInteger(pAddress3, txId))) | |
117 | 112 | then true | |
118 | - | else sigVerify(tx.bodyBytes, tx.proofs[ | |
113 | + | else sigVerify(tx.bodyBytes, tx.proofs[2], protector2)) | |
119 | 114 | then 1 | |
120 | 115 | else 0 | |
121 | 116 | (((pKey1Signed + pKey2Signed) + pKey3Signed) >= 3) | |
122 | 117 | case _: LeaseTransaction => | |
123 | 118 | false | |
124 | 119 | case _: SponsorFeeTransaction => | |
125 | 120 | false | |
126 | 121 | case _: MassTransferTransaction => | |
127 | 122 | false | |
128 | 123 | case _: IssueTransaction => | |
129 | 124 | false | |
130 | 125 | case _: ReissueTransaction => | |
131 | 126 | false | |
132 | 127 | case _: BurnTransaction => | |
133 | 128 | false | |
134 | 129 | case _: ExchangeTransaction => | |
135 | 130 | false | |
136 | 131 | case tx: InvokeScriptTransaction => | |
137 | 132 | match tx.payment { | |
138 | 133 | case _: AttachedPayment => | |
139 | 134 | match getInteger(getAddressFromBook(dAppWhitelistAddressKey), toBase58String(addressFromRecipient(tx.dApp).bytes)) { | |
140 | 135 | case _: Int => | |
141 | 136 | true | |
142 | 137 | case _ => | |
143 | 138 | false | |
144 | 139 | } | |
145 | 140 | case _ => | |
146 | 141 | true | |
147 | 142 | } | |
148 | 143 | case _ => | |
149 | 144 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
150 | 145 | } |
github/deemru/w8io/169f3d6 24.77 ms ◑