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